/*
    owo
*/

@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Sans:ital,wght@0,100..800;1,100..800&display=swap');

:root {
    --hue: var(--base-hue, 255);
    --sat: var(--saturation, 1);
    --lit: var(--lightness, 1);
    --ovr: var(--invert-btn, var(--b7));

    --font: Ubuntu Sans, Spline Sans, Inter, Roboto, Noto Sans, Noto Sans JP, Noto Color Emoji, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: Spline Sans Mono, Iosevka, JetBrains Mono, Roboto Mono, monospace;
    --font-size: 14px;
    --line-height: calc(var(--font-size) + 4px);
    --font-size-sm: 12px;
    --line-height-sm: calc(var(--font-size-sm) + 4px);

    --font-weight: 480;
    --font-weight-medium: 650;
    --font-weight-bold: 730;

    --trans: 0.3s;
	--trans-function: cubic-bezier(1.000, 0.000, 0.000, 1.000);
}

/* backgrounds */
:root,
.chip, .window,
.badge, .tag-mono, .tag,
.status-dot, .status,
/* lfm */ .install,
.panel
{
    /* any additional highlights */
    --b3: var(--hue), calc(var(--sat) * 6%), 28%;

    /* card border */
    --b4: var(--hue), calc(var(--sat) * 8%), 22%;

    /* card */
    --b5: var(--hue), calc(var(--sat) * 10%), 15%;

    /* root */
    --b6: var(--hue), calc(var(--sat) * 14%), 10%;
    --b7: 0, 0%, 0%;
}

/* text */
:root,
.chip, .window,
.badge, .tag-mono, .tag,
.status-dot, .status,
/* lfm */ .install,
.panel, .btn,
.kate-icon,
strong,
.badge,
.sub,
.alert
{
    --c1: var(--hue), calc(var(--sat) * 40%), 100%;
    --c2: var(--hue), calc(var(--sat) * 60%), 90%;
    --c3: var(--hue), calc(var(--sat) * 10%), 60%;
    --ov-c1: var(--c1);

    --l2: var(--hue), calc(var(--sat) * 50%), calc(var(--lit) * 83%);
    --l3: var(--hue), calc(var(--sat) * 60%), calc(var(--lit) * 70%);
    --l4: var(--hue), calc(var(--sat) * 70%), calc(var(--lit) * 50%);

    --l2-c: var(--hue), calc(var(--sat) * 50%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 83%);
    --l3-c: var(--hue), calc(var(--sat) * 60%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 70%);
    --l4-c: var(--hue), calc(var(--sat) * 70%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 50%);

    --h2: var(--l2-c);
    --h3: var(--l3-c);
    --h4: var(--l4-c);

    --icon: var(--c2);
}


/* attributes */
:root {
    --card-padding: 20px;
    --card-radius: var(--item-big-radius);
    --card-shadow: hsla(var(--b7), 0.25) 0 2px 4px 0;
    --card-gap: 15px;
    --card-border: unset;

    --cards-main-width: 902px; /* this makes it not 777, the grid looks better okay */
    --cards-sidebar-width: 400px;
    --cards-width: calc(var(--cards-main-width) + var(--cards-sidebar-width) + var(--card-gap));

    --item-small-radius: 4px;
    --item-med-radius: 6px;
    --item-big-radius: 9px;

    --profile-header-avatar-size: 96px;
    --profile-header-avatar-small-size: 54px;
    --profile-header-background-height: 200px;
    --profile-header-background-offset: 33%;

    --shout-avatar-size: 52px;
    --shout-inset: 52px;

    --menu-shadow: 2px 2px 24px 0 hsla(var(--b7), 0.35), 3px 6px 48px 16px hsla(var(--b7), 0.25);
    --menu-overlay-shadow: 0 -250px 10px 100px hsla(var(--b6), 70%);
    --avatar-shadow: 3px 6px 15px 10px hsla(var(--b7), 0.05);
    --standout-shadow: 3px 6px 32px 16px hsla(var(--b7), 0.2);

    --interactable-outer: hsla(var(--b7), 0.3) 0 2px 3px 0;
    --interactable-active-outer: hsla(var(--c1), 0.03) 0 2px 25px 0;

    --interact-shadow: var(--interactable-outer);
    --active-shadow: var(--interactable-outer), var(--interactable-active-outer);

    --chartlist-fill: var(--hue-gradient, hsl(var(--l3)));

    --gradient-lesbian: linear-gradient(to right, rgb(213, 44, 0), rgb(226, 150, 136), rgb(255, 255, 255) 45%, rgb(255, 255, 255), rgb(255, 255, 255) 55%, rgb(210, 127, 164), rgb(162, 2, 98));
    --gradient-trans: linear-gradient(to right, rgb(85, 205, 252), rgb(179, 157, 233), rgb(247, 168, 184), rgb(246, 216, 221), rgb(255, 255, 255) 45%, rgb(255, 255, 255), rgb(255, 255, 255) 55%, rgb(246, 216, 221), rgb(247, 168, 184), rgb(179, 157, 233), rgb(85, 205, 252));
    --gradient-fluid: linear-gradient(to right, rgb(255, 120, 166), rgb(247, 196, 210), rgb(255, 255, 255) 23%, rgb(255, 255, 255), rgb(255, 255, 255) 28%, rgb(219, 148, 213), rgb(190, 20, 215), rgb(89, 22, 85), rgb(0, 0, 0) 73%, rgb(0, 0, 0), rgb(0, 0, 0) 78%, rgb(51, 36, 87), rgb(50, 60, 191));
}


[data-theme="light"], [time-of-day="morning"], [time-of-day="afternoon"] {
    --card-shadow: hsla(var(--b7), 0.05) 0 2px 4px 0;

    --menu-shadow: 2px 2px 24px 0 hsla(var(--b7), 0.15), 3px 6px 48px 16px hsla(var(--b7), 0.03);

    --interact-shadow: hsla(var(--b7), 0.07) 0 2px 4px 0;
}

[data-theme="light"], [time-of-day="morning"], [time-of-day="afternoon"],
:is([data-theme="light"], [time-of-day="morning"], [time-of-day="afternoon"]) :is(
    .chip, .window,
    .badge, .tag-mono, .tag,
    .status-dot, .status,
    /* lfm */ .install,
    .panel, .btn,
    .kate-icon
)
{
    /* card border */
    --b4: var(--hue), calc(var(--sat) * 6%), 89%;

    /* card */
    --b5: 0, 0%, 100%;

    /* root */
    --b6: 0, 0%, 98%;
    --b7: 0, 0%, 0%;
}

[data-theme="light"], [time-of-day="morning"], [time-of-day="afternoon"],
:is([data-theme="light"], [time-of-day="morning"], [time-of-day="afternoon"]) :is(
    .chip, .window,
    .badge, .tag-mono, .tag,
    .status-dot, .status,
    /* lfm */ .install,
    .panel, .btn,
    .kate-icon,
    strong,
    .badge,
    .sub
)
{
    --c1: var(--hue), calc(var(--sat) * 6%), 0%;
    --c2: var(--hue), calc(var(--sat) * 4%), 4%;
    --c3: var(--hue), calc(var(--sat) * 10%), 30%;
    --ov-c1: var(--hue), calc(var(--sat) * 40%), 100%;

    --l2: var(--hue), calc(var(--sat) * 40%), calc(var(--lit) * 63%);
    --l3: var(--hue), calc(var(--sat) * 50%), calc(var(--lit) * 55%);
    --l4: var(--hue), calc(var(--sat) * 60%), calc(var(--lit) * 25%);

    --l2-c: var(--hue), calc(var(--sat) * 40%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 63%);
    --l3-c: var(--hue), calc(var(--sat) * 50%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 55%);
    --l4-c: var(--hue), calc(var(--sat) * 60%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 25%);

    --h3: var(--hue), calc(var(--sat) * 50%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 80%);
    --h4: var(--hue), calc(var(--sat) * 60%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 65%);
}


[data-theme="oled"], [time-of-day="night"] {
    --card-shadow: hsla(var(--b7), 0.05) 0 2px 4px 0;

    --menu-shadow: 2px 2px 24px 0 hsla(var(--b7), 0.15), 3px 6px 48px 16px hsla(var(--b7), 0.03);

    --interact-shadow: hsla(var(--b7), 0.07) 0 2px 4px 0;
}

[data-theme="oled"], [time-of-day="night"],
:is([data-theme="oled"], [time-of-day="night"]) :is(
    .chip, .window,
    .badge, .tag-mono, .tag,
    .status-dot, .status,
    /* lfm */ .install,
    .panel, .btn,
    .kate-icon
)
{
    /* card border */
    --b4: var(--hue), calc(var(--sat) * 8%), 8%;

    /* card */
    --b5: var(--hue), calc(var(--sat) * 20%), 2%;

    /* root */
    --b6: 0, 0%, 0%;
    --b7: 0, 0%, 0%;
}

[data-theme="oled"], [time-of-day="night"],
:is([data-theme="oled"], [time-of-day="night"]) :is(
    .chip, .window,
    .badge, .tag-mono, .tag,
    .status-dot, .status,
    /* lfm */ .install,
    .panel, .btn,
    .kate-icon,
    strong,
    .badge,
    .sub
)
{
    --c1: var(--hue), calc(var(--sat) * 40%), 100%;
    --c2: var(--hue), calc(var(--sat) * 60%), 90%;
    --c3: var(--hue), calc(var(--sat) * 10%), 60%;

    --l3: var(--hue), calc(var(--sat) * 50%), calc(var(--lit) * 75%);
    --l4: var(--hue), calc(var(--sat) * 60%), calc(var(--lit) * 45%);

    --l3-c: var(--hue), calc(var(--sat) * 50%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 70%);
    --l4-c: var(--hue), calc(var(--sat) * 60%), calc(clamp(min(0.5), var(--lit), max(1.5)) * 45%);

    --h2: var(--l2-c);
    --h3: var(--l3-c);
    --h4: var(--l4-c);

    --icon: var(--c2);
}




/*     BASIC STYLES     */
body {
    background: hsl(var(--b6));
    color: hsl(var(--c2));
    font-family: var(--font);
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-weight: var(--font-weight);
    letter-spacing: unset !important;
    color-scheme: dark;
    accent-color: hsl(var(--l3-c));
    overflow-x: hidden;
}
body:before {
    content: '';
    inset: 0;
    position: fixed;
    z-index: 100000000000;
    opacity: 0.23;
    pointer-events: none;
    background-image: var(--noise);

    display: none;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll);
}

::selection {
    background: hsla(var(--h4), 20%);
    color: hsl(var(--l3-c));
}
::-moz-selection {
    background: hsla(var(--h4), 20%);
    color: hsl(var(--l3-c));
}

h1, h2, h3, h4, h5 {
    font-weight: var(--font-weight-bold);
    color: hsl(var(--c1));
    user-select: none;
}
h3,
h4,
h5 {
    font-weight: var(--font-weight-medium);
}

h1 {
    font-size: 30px;
    line-height: 34px;

    &.big {
        font-size: 46px;
        line-height: 48px;
        margin-bottom: 10px;
    }
}
h2 {
    font-size: 24px;
    line-height: 28px;
}
h3 {
    font-size: 20px;
    line-height: 24px;
}
h4 {
    font-size: 16px;
    line-height: 20px;
}
h5 {
    display: flex;
    gap: var(--card-gap);
}


img {
    user-select: none;
}


/* indent on click */
:is(
    .btn,
    .chip,
    [type="radio"], [type="checkbox"],
    .card:not(.has-footer),
    .install2,
    .toggle
):active
{
    transform: scale(var(--indent));
}


/* links */
a:not(:is(.btn, .card)) {
    color: hsl(var(--l3-c));
    transition-property: color;
    transition-duration: var(--trans);
    text-underline-offset: 3px;
}


strong, em {
    font-weight: var(--font-weight-bold);
}


.sep {
    width: 100%;
    height: 1px;
    background-color: hsl(var(--b4));
    margin: var(--card-gap) 0;
}
.gap {
    width: 100%;
    height: var(--gap);
}


footer:not(.window footer) {
    margin-top: 240px;
    color: hsl(var(--c3));
    display: flex;
    justify-content: center;

    .content {
        border-top: 1px solid hsl(var(--b4));
        padding: calc(var(--card-gap) * 4) 0;
        display: flex;
        flex-direction: column;
        width: var(--cards-width);

        .main {
            font-size: 24px;
            line-height: 30px;
            font-weight: 700;

            a {
                color: hsl(var(--c2));

                &:hover {
                    color: hsla(var(--c2), 80%);
                }
            }
        }
    }

    a:not(.btn) {
        color: hsl(var(--c3));
        text-decoration: none;

        &:hover {
            color: hsla(var(--c3), 80%);
            transition: none;
        }
    }

    .links {
        display: flex;
        gap: var(--card-gap);
    }
}


/* icon */
svg.icon {
    width: var(--w);
    height: var(--w);
}

.w-12 {
    --w: 12px;
    stroke-width: 2.5;
}
.w-16 {
    --w: 16px;
    stroke-width: 2.5;
}
.w-18 {
    --w: 18px;
    stroke-width: 2.5;
}
.w-20 {
    --w: 20px;
    stroke-width: 2.25;
}
.w-24 {
    --w: 24px;
}
.w-28 {
    --w: 28px;
}
.w-32 {
    --w: 32px;
}
.w-48 {
    --w: 48px;
}


.text-12 {
    font-size: 12px;
    line-height: 16px;
}
.text-14 {
    font-size: 14px;
    line-height: 18px;
}
.text-16 {
    font-size: 16px;
    line-height: 20px;
}
.text-18 {
    font-size: 18px;
    line-height: 22px;
}


.figure {
    display: flex;
    width: 100%;
}
.figure img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--menu-shadow);
}


.caption:not(.browser .caption) {
    margin-top: var(--card-gap);
    color: hsl(var(--c3));
    font-size: var(--font-size-sm);
    line-height: var(--line-height-sm);

    &:not(.no-line) {
        padding-top: var(--card-gap);
        border-top: 1px solid hsl(var(--b4));
        display: flex;
        gap: 6px;
    }
}
.caption strong {
    padding: 0 6px;
    background: hsl(var(--b6));
    border-radius: var(--item-small-radius);
}




/*     header     */
body {
    padding-top: calc(40px + var(--card-gap));
}
header:not(.window header) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--card-gap) 0;

    &:before {
        content: '';
        position: fixed;
        left: 0;
        top: 0;
        right: 0;
        height: 80px;
        z-index: 10;
        background: linear-gradient(0deg, transparent 0%, hsl(var(--b6)) 100%);
        pointer-events: none;
    }

    & > .content {
        width: var(--cards-width);
        height: 40px;
        display: flex;
        align-items: center;
        z-index: 11;
        padding: 0 var(--card-padding);

        .logo {
            display: flex;
            align-items: center;
            flex: 1;

            a:not(.btn) {
                font-size: 28px;
                line-height: 28px;
                margin-top: -8px;
                font-family: var(--font-brand);
                color: hsl(var(--l3-c));
                text-decoration: none;
            }
        }

        .nav {
            display: flex;
            a {
                --bg: transparent;
                --bg-hov: transparent;
                --bg-atv: transparent;
                --shadow: none;
                --shadow-hov: none;
                --padding: 11px 16px;
                gap: 8px;

                &:hover {
                    color: hsl(var(--c1));
                }
            }
        }
    }
}