/* RESET CSS */
/* https://piccalil.li/blog/a-more-modern-css-reset/ */
/* https://www.joshwcomeau.com/css/custom-css-reset/ */

*,
*::before,
*::after { box-sizing: border-box; }

html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

body {
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4,
button, input, label { line-height: 1.1; }

h1, h2,
h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

img,
picture {
    display: block;
    max-width: 100%;
}

input, button,
textarea, select { font: inherit; }

textarea:not([rows]) { min-height: 10em; }
:target { scroll-margin-block: 5ex; }

/* GLOBAL CSS */

@font-face {
    font-family: "Ioskeley";
    src: url("assets/IoskeleyMono-Regular.woff2");
}

@keyframes flicker-opacity {
    0%   { opacity: 1; }
    50%  { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes flicker-background {
    0%   { background-color: white; }
    50%  { background-color: transparent; }
    100% { background-color: white; }
}

@keyframes fade-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@media (scripting: none) { body { background-color: #2B3554; } }

body {
    height: 100vh;
    font-family: system-ui, sans-serif;
    font-size: 1.5rem;
    color: white;
}

#background {
    position: fixed;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

.nav-main {
    display: grid;
    grid-template-columns: 1fr min(50ch, 100%) 1fr;
    gap: 4rem;
    height: 100vh;
    padding-block: 4rem;

    & main {
        overflow-y: scroll;
        scrollbar-width: none;
    }
}

.sidebar {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;

    & ul {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: max-content;
        margin: 0;
        padding: 0;
        font-stretch: ultra-expanded;
        list-style-type: none;
    }

    & a {
        display: block;
        padding: 0.5rem 1rem;
        text-decoration: none;
    }
}

article {
    & > *:first-child { margin-top:0; }

    /* & > * + * { margin-block-start: 1.5rem; } */
    & h1, h2 {
        padding: 0.5rem 1rem;
        background-color: white;
        color: black;
        mix-blend-mode: screen;
    }

    & a { font-weight: bold; }
    & h1 { font-stretch: ultra-expanded; }
    & h2 { width: max-content; }
    & h2, h3, p, li, dt, dd {
        font-family: Ioskeley, ui-monospace, monospace;
        font-size: inherit;
    }
}

a:not(.filled) {
    color: white;
    &:hover {
        background-color: white;
        color: black;
        mix-blend-mode: screen;
        text-decoration: none;
        animation: flicker-background 0.15s 1;
    }
}

.border { border: 1px solid white; }
.filled {
    background-color: white;
    mix-blend-mode: screen;
    color: black;
    text-decoration: none;
    &:hover { animation: flicker-background 0.1s 2; }
}

.flicker {
    opacity: 0;
    animation: flicker-opacity 0.1s 2 forwards;
}

.trickle > * {
    opacity: 0;
    animation: flicker-opacity 0.1s forwards;
    &:nth-child(1) { animation-delay:   0ms; }
    &:nth-child(2) { animation-delay: 100ms; }
    &:nth-child(3) { animation-delay: 200ms; }
    &:nth-child(4) { animation-delay: 300ms; }
    &:nth-child(5) { animation-delay: 400ms; }
    &:nth-child(6) { animation-delay: 500ms; }
}

.trickle-fast > * {
    opacity: 0;
    animation: fade-in 0.1s forwards;
    &:nth-child(1) { animation-delay:   0ms; }
    &:nth-child(2) { animation-delay:  50ms; }
    &:nth-child(3) { animation-delay: 100ms; }
    &:nth-child(4) { animation-delay: 150ms; }
    &:nth-child(5) { animation-delay: 200ms; }
    &:nth-child(6) { animation-delay: 250ms; }
    &:nth-child(7) { animation-delay: 300ms; }
    &:nth-child(8) { animation-delay: 350ms; }
    &:nth-child(9) { animation-delay: 400ms; }
    &:nth-child(10) { animation-delay: 450ms; }
}

/* PAGE SPECIFIC */

#splash {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: max-content;
    height: 100%;
    margin-inline: auto;
    font-stretch: ultra-expanded;

    & h1 {
        margin: 0;
        text-wrap: nowrap;
        text-align: center;
        font-size: clamp(3rem, 10vw, 8rem);
        font-weight: 800;
    }

    & span:has(a) { align-self: flex-end; }
    & a { padding: 0.5rem 2rem; }
}

