@layer theme, base, components, utilities;
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/preflight.css' layer(base);
@import 'tailwindcss/utilities.css' layer(components);

@config '../tailwind.config.ts';

/* Apply hover styles on :hover directly instead of gating them behind
   @media (hover: hover), which never matches on devices reporting hover: none. */
@custom-variant hover (&:hover);
@custom-variant group-hover (&:is(:where(.group):hover *));

@theme {
    --breakpoint-100px: 100px;
	--breakpoint-200px: 200px;
	--breakpoint-300px: 300px;
	--breakpoint-432px: 432px;
	--breakpoint-350px: 350px;
	--breakpoint-400px: 400px;
	--breakpoint-450px: 450px;
	--breakpoint-500px: 500px;
	--breakpoint-600px: 600px;
	--breakpoint-700px: 700px;
	--breakpoint-800px: 800px;
	--breakpoint-900px: 900px;
	--breakpoint-1000px: 1000px;
	--breakpoint-1200px: 1200px;

    --breakpoint-xs: 30rem;
    --breakpoint-2xl: 100rem;
    --breakpoint-3xl: 120rem;
    
    --color-login: #fd8738;
    --color-login-950: #0e0e0e;
    --color-login-900: #121212;
    --color-login-800: #181818;
    --color-login-700: #1a1a1a;
    --color-login-600: #212121;
    --color-login-500: #323232;
    --color-login-400: #424242;
    --color-login-300: #5e5e5e;
    --color-login-200: #727272;
    --color-login-100: #b0b0b0;
    --color-login-75: #e4e4e4;
    --color-login-50: #ededed;

    --color-login-text: #ededed;
}

@utility noscroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
    &::-webkit-scrollbar {
        display: none;
    }
}

@utility no-calendar {
    &::-webkit-calendar-picker-indicator {
        -webkit-appearance: textfield;
    }
}

:root {
    transition:
        background 0.4s,
        color 0.4s,
}

.dark {
    --background: #0e0e0e;
    --foreground: #ededed;

    --color-login: #fd8738;
    --color-login-950: #0e0e0e;
    --color-login-900: #121212;
    --color-login-800: #181818;
    --color-login-700: #1a1a1a;
    --color-login-600: #212121;
    --color-login-500: #323232;
    --color-login-400: #424242;
    --color-login-300: #5e5e5e;
    --color-login-200: #8a8a8a;
    --color-login-100: #b0b0b0;
    --color-login-50: #ededed;

    --color-login-text: #ededed;
}

.light {
    --background: #ededed;
    --foreground: #0e0e0e;

    --color-login: #fd8738;
    --color-login-950: #bebebe;
    --color-login-900: #c0c0c0;
    --color-login-800: #cfcfcf;
    --color-login-700: #d9d9d9;
    --color-login-600: #e3e3e3;
    --color-login-500: #ebebeb;
    --color-login-400: #f3f3f3;
    --color-login-300: #f7f7f7;
    --color-login-200: #fafafa;
    --color-login-100: #fcfcfc;
    --color-login-50: #ffffff;

    --color-login-text: #0e0e0e;
}

@utility prose-custom {
    line-height: 24px;
    --tw-prose-body: var(--color-login-text);
    --tw-prose-headings: var(--color-login-text);
    --tw-prose-lead: var(--color-login-300);
    --tw-prose-links: var(--color-login);
    --tw-prose-bold: #fff;
    --tw-prose-counters: var(--color-login);
    --tw-prose-bullets: var(--color-login);
    --tw-prose-hr: var(--color-login-300);
    --tw-prose-quotes: var(--color-login-text);
    --tw-prose-quote-borders: var(--color-login);
    --tw-prose-captions: var(--color-login-300);
    --tw-prose-code: var(--color-login-text);
    --tw-prose-pre-code: var(--color-login-text);
    --tw-prose-pre-bg: var(--color-login-900);
    --tw-prose-th-borders: var(--color-login-500);
    --tw-prose-td-borders: var(--color-login-500);

    & p {
        margin-top: 0.25rem;
        margin-bottom: 0.75rem;
    }

    & li {
        margin-top: 0;
        margin-bottom: 0;
    }

    & ul:has(> li > span[data-task-checkbox]) {
        padding-left: 0;
    }

    & li:has(> span[data-task-checkbox]) {
        list-style: none;
    }
}

@import 'highlight.js/styles/github-dark.css';

.hljs {
    background: transparent;
}

pre code.hljs {
    padding: 0;
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@utility animate-shimmer {
    background: linear-gradient(90deg, var(--color-login-600) 25%, var(--color-login-500) 50%, var(--color-login-600) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes jump {
    40% {
        transform: translateY(-0.3rem);
    }
}

@utility animate-jump {
    animation: jump 0.4s 1;
}

@utility link-corner-hover {
    position: relative;
    
    &::after {
        content: ' ';
        position: absolute;
        width: .8em;
        height: .8em;
        bottom: .4em;
        right: .4em;
        border-right: .2em solid transparent;
        border-bottom: .2em solid transparent;
        transition: .2s;
    }
    
    &:hover::after {
        border-color: var(--color-login);
        right: 0;
        bottom: 0;
    }
}

@utility page-container {
    display: grid;
    grid-template-columns: 1fr 1rem minmax(0, 72rem) 1rem 1fr;
    padding-top: 0rem;

    @media (min-width: 800px) {
        grid-template-columns: 1fr 2rem minmax(0, 72rem) 2rem 1fr;
        padding-top: 2rem;
    }
}

@utility heading {
    z-index: 2;
    font-weight: 600;
    font-size: 2.1rem;
    margin: 1rem 0;
    padding: .3em 0;
    padding-left: 0px;
    line-height: 1.2em;

    @media only screen and (min-width: 400px) {
        font-size: 3.5rem;
    }

    @media only screen and (min-width: 800px) {
        &::before {
            padding-left: 1.5rem;
            font-size: 3.5rem;
            z-index: -1;
            content: "";
            border-width: .7rem;
            border-color: var(--color-login-500);
            z-index: 2;
            border-style: solid none none solid;
            width: 2.6rem;
            height: 2.6rem;
            margin-top: -.8rem;
            margin-left: -1.5rem;
            transition: all .1s;
            position: absolute;
        }
    }
}

@utility highlighted-section {
    line-height: 1.8rem;
    border-left: .3rem solid var(--color-login);
    max-width: 50rem;
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
    padding: .5rem 0 .5rem 1rem;
    font-size: 1.2rem;
    font-weight: 500;
}

@utility anchor-popup {
    top: 100%;
    left: 0;
    
    @supports (position-anchor: --foo) {
        top: auto;
        left: auto;
    }
}

/* Hide default browser icons/buttons for inputs */
input::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type='number'] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

input::-webkit-search-decoration,
input::-webkit-search-cancel-button,
input::-webkit-search-results-button,
input::-webkit-search-results-decoration {
    -webkit-appearance: none !important;
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
}

input::-ms-reveal,
input::-ms-clear {
    display: none !important;
}

@layer base {
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}
