:root {
    --body-margin: 16px;
    --max-page-width: 1300px;

    --brush-base-delay: 0.25s;
    --brush-speed: 0.4s;
    --melon-cycle-speed: 10s;

    --bg-color: #fcf7ee;
    --bg-color-dark: #bea678;
    --accent-color: #01ff8d;
    --accent-color-dark: #0e6210; /* >:3 */
    --font-color: #333333; /* :3 */
    --font-color-muted: #666666; /* D: */

    --color-positive: rgb(132, 245, 132);
    --color-negative: rgb(224, 106, 106);
}

::selection {
    color: var(--font-color);
    background-color: var(--accent-color);
}

@font-face {
    font-family: "Wisdom";
    src: url("font/Wisdom.otf"), local("Times New Roman");
}

@font-face {
    font-family: "Yaelah";
    src: url("font/Yaelah.ttf");
}

html {
    font-family: "Yaelah", Helvetica, sans-serif;
    font-size: 22px;
    color: var(--font-color);
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: red;
}

body {
    background-color: var(--bg-color);
    margin: var(--body-margin);
    margin-top: 0;
}

main {
    max-width: var(--max-page-width);
    width: 100%;

    position: relative;

    display: grid;
    gap: 64px;
}

h1 {
    font-family: "Wisdom";
    font-size: 72px;
    letter-spacing: 4px;
    margin: 0;
    scroll-margin-top: 200px;
}

h2 {
    font-family: "Wisdom";
    font-size: 36px;
    margin: 0;
    scroll-margin-top: 220px;
}

details > summary {
    cursor: pointer;
}

.slowBobAnim {
    animation-name: slow-bob-anim;
    animation-duration: 1.5s;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
}

@keyframes slow-bob-anim {
    0% {
        transform: none;
    }

    100% {
        transform: translateY(-10px);
    }
}

.textAccent {
    color: var(--accent-color);
    -webkit-text-stroke-color: var(--font-color);
    -webkit-text-stroke-width: 1px;
}

a {
    color: var(--accent-color);
    -webkit-text-stroke-color: var(--font-color);
    -webkit-text-stroke-width: 1px;
}

small {
    color: var(--font-color-muted);
}

.btn {
    display: inline-block;
    /* Invert colors: */
    color: var(--bg-color);
    background-color: var(--font-color);
    -webkit-text-stroke-width: 0;
    text-decoration: none;

    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 32px;
    padding-right: 32px;

    border-radius: 24px;
    box-sizing: border-box;

    cursor: pointer;
    border-style: solid;
    border-width: 2px;
    border-color: var(--bg-color);

    font: inherit;

    transition: background-color 0.1s ease, color 0.1s ease, transform 0.1s ease;
}

.btn:hover,
.btn:focus {
    background-color: var(--accent-color);
    color: var(--font-color);
}

.btn:active {
    transform: translateY(2px);
}

.btnIcon {
    padding-left: 11px;
    padding-right: 11px;
}

.btnRainbow {
    border-width: 6px;
    border-style: solid;
    position: relative;

    animation-name: rainbowBorder-anim;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
    animation-timing-function: linear;
}

.btnRainbow::before {
    content: "";
    position: absolute;
    left: -11px;
    top: -11px;
    width: calc(100% + 22px);
    height: calc(100% + 22px);
    z-index: -1;
    border-radius: 30px;
    background-color: var(--font-color);

    transition: background-color 0.1s ease;
}

.btnRainbow:hover,
.btnRainbow:focus {
    border-color: var(--accent-color) !important;
}

.btnRainbow:hover::before,
.btnRainbow:focus::before {
    background-color: var(--accent-color);
}

@keyframes rainbowBorder-anim {
    0% {
        border-color: #ffb3b3;
    } /* Pastel Red */
    16.6% {
        border-color: #ffd9b3;
    } /* Pastel Orange */
    33.3% {
        border-color: #ffffb3;
    } /* Pastel Yellow */
    50% {
        border-color: #b3ffb3;
    } /* Pastel Green */
    66.6% {
        border-color: #b3d9ff;
    } /* Pastel Blue */
    83.3% {
        border-color: #d9b3ff;
    } /* Pastel Indigo */
    100% {
        border-color: #ffb3ff;
    } /* Pastel Violet */
}

*[data-tooltip-text] {
    position: relative;
}

*[data-tooltip-text]::before {
    content: attr(data-tooltip-text);
    position: absolute;

    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 10px);
    width: 200px;

    padding-left: 6px;
    padding-right: 6px;
    padding-top: 12px;
    padding-bottom: 12px;

    font-family: "Yaelah";
    font-size: 17px;
    -webkit-text-stroke-width: 0;
    text-align: center;

    background-color: var(--font-color);
    color: var(--bg-color);
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    border-radius: 12px;

    display: none;

    animation-name: tooltip-in-anim;
    animation-duration: 0.2s;
    animation-iteration-count: 1;
    animation-fill-mode: both;
}

*[data-tooltip-text]::after {
    content: "";
    position: absolute;

    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% - 8px);

    border: 10px solid var(--font-color);
    border-color: var(--font-color) transparent transparent transparent;

    display: none;

    animation-name: tooltip-in-anim;
    animation-duration: 0.2s;
    animation-iteration-count: 1;
    animation-fill-mode: both;
}

*[data-tooltip-text]:hover::before,
*[data-tooltip-text]:hover::after,
*[data-tooltip-text]:focus::before,
*[data-tooltip-text]:focus::after {
    display: block;

    pointer-events: none;
}

@keyframes tooltip-in-anim {
    0% {
        transform: translateX(-50%) translateY(32px) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%);
        opacity: 1;
    }
}

hr {
    border: none;
    border-top: 2px dashed var(--font-color);
    width: 100%;
    max-width: 1000px;

    margin-top: 16px;
    margin-bottom: 16px;
}

.spoiler {
    cursor: help;
    filter: blur(3px);
}

.spoiler:hover,
.spoiler:active,
.spoiler:focus {
    filter: none;
}

.textNegative {
    color: var(--color-negative);
}

.textPositive {
    color: var(--color-positive);
}

dialog::backdrop {
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.5);
}

dialog {
    max-height: 90vh;
    min-width: 50vw;
    max-width: min(1000px, 90vw);
    box-sizing: border-box;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

dialog .dialogHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px;
    margin-bottom: 32px;

    border-bottom-color: var(--bg-color);
    border-bottom-width: 2px;
    border-bottom-style: solid;

    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;

    position: sticky;
    top: 0;
    background-color: var(--font-color);
    z-index: 2;
}

dialog .dialogHeader h3 {
    margin: 0;
    font-size: 32px;
    font-family: "Wisdom";
}

dialog .dialogBody {
    padding-bottom: 32px;
    padding-left: 32px;
    padding-right: 32px;

    line-height: 1.25em;
}

dialog .dialogBody h4 {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    margin-top: 80px;
}

dialog .dialogBody h4::after {
    content: "";
    position: absolute;
    left: auto;
    top: 50%;
    width: 100%;
    margin-left: 16px;
    border-top-color: var(--font-color-muted);
    border-top-style: dashed;
    border-top-width: 2px;
}

dialog table {
    border-collapse: collapse;
}

dialog thead tr th {
    border-bottom: 2px solid var(--bg-color);
}

dialog tbody tr > td:first-child {
    border-right: 2px solid var(--bg-color);
}

dialog td {
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 16px;
    padding-right: 16px;
}

input[type="checkbox"] {
    appearance: none;
    background-color: var(--bg-color);
    margin: 0;
    font: inherit;

    position: relative;

    width: 1.15em;
    height: 1.15em;
    border: 3px solid var(--font-color);
    border-radius: 8px;

    cursor: pointer;

    transition: background-color 0.1s ease;
}

input[type="checkbox"]:checked {
    background-color: var(--accent-color);
}

input[type="checkbox"]:checked::before {
    content: "✓";
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:focus {
    outline: max(1px, 0.15em) solid var(--font-color-muted);
    outline-offset: max(1px, 0.15em);
}

input[type="checkbox"]:disabled {
    background-color: var(--font-color-muted);
}

.checkboxLabel {
    cursor: pointer;
}

/* ------------------------------------------------------------------------------------- */
/*#region Mobile styling*/
@media (width <= 1000px) {
    dialog {
        max-width: 100vw;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    dialog .dialogHeader {
        padding: 16px;
    }

    dialog .dialogHeader h3 {
        font-size: 24px;
    }

    dialog .dialogBody {
        padding-left: 16px;
        padding-right: 16px;
    }

    dialog .dialogBody h4 {
        max-width: calc(100%);
    }
}

/*#endregion Mobile styling*/
/* ------------------------------------------------------------------------------------- */
