/* base.css */
@font-face {
    font-family: "Gorgeous Pixel";
    src: url("../font/gorgeous_pixel.ttf") format("truetype");
}

@font-face {
    font-family: "Chivo Mono";
    src: url("../font/chivo_mono.ttf") format("truetype");
}

/* properties */
:root {
    --primary-color: light-dark(#ff2462, #ff4d6d);
    --background-color: light-dark(#f5f5f5, #0a0a0a);
    --text-color: light-dark(#0a0a0a, #f5f5f5);

    --primary-max-width: 824px;
    --primary-padding: 2rem;
    --padding: 0.5rem;

    --header-font: "Gorgeous Pixel", cursive, sans-serif;
    --default-font: "Chivo Mono", monospace;
}

/* media */
@media (max-width: 550px) {
    :root {
        --padding: 1rem;
    }
}

/* globals */
* {
    padding: 0;
    margin: 0;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);

    text-align: justify;
    font-family: var(--default-font);
}

primary {
    box-sizing: border-box;
    flex-direction: column;
    display: flex;
    gap: var(--padding);

    padding: var(--primary-padding);
    margin: 0 auto;

    max-width: var(--primary-max-width);
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

nav {
    /* vertically align text */
    display: flex;
    align-items: center;
    gap: var(--padding);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: var(--padding);
}

footer {
    margin-top: auto;
    padding: var(--padding);
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1, h2, h3,
h4, h5, h6 {
    font-family: var(--header-font);
    color: var(--primary-color);
}

a {
    color: var(--primary-color);
    text-decoration-style: dotted;
}

a[target="_blank"]::after {
    /* holy hack */
    /* this is used for the "opens externally":tm: icon */
    background-color: var(--primary-color);
    content: '';
    
    display: inline-block;
    vertical-align: -0.2em;
    margin-left: 0.125em;
    height: 1em;
    width: 1em;
    
    /* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
    -webkit-mask-size: contain;
    -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 7H5v12h12v-6h2v8H3V5h8v2Zm0 8H9v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V9h2v2Zm6 0h-2V7h-2V5h-4V3h8v8Zm-4-2h-2V7h2v2Z"/></svg>');

    mask-size: contain;
    mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 7H5v12h12v-6h2v8H3V5h8v2Zm0 8H9v-2h2v2Zm2-2h-2v-2h2v2Zm2-2h-2V9h2v2Zm6 0h-2V7h-2V5h-4V3h8v8Zm-4-2h-2V7h2v2Z"/></svg>');
}

a[target="_blank"]:hover::after {
    background-color: var(--text-color);
}

a:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: underline;
}

ol, ul {
    padding-left: 1.5ch;
}

/* site constants */
#root-navigator {
    background: none;
    text-decoration: none;
}

#root-theme {
    height: 19px;
    width: 19px;
    
    shape-rendering: crispEdges;
    color: var(--primary-color);
    background: none;
    cursor: pointer;
    border: none;

    display: flex;
    align-items: center;
    justify-content: center;
}

#root-theme svg {
    width: 14px;
    height: 14px;
}

#root-theme:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
}

#ascii-art {
    --cols: 1;
    --rows: 1;

    position: fixed;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    
    font-family: monospace;
    white-space: pre;
    z-index: -1;
    
    line-height: 1;
    font-size: min(
        calc(80vw / var(--cols)),
        calc(80vh / var(--rows))
    );

    color: var(--primary-color);
    opacity: 0.1;

    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* generic classes */
.alt-heading {
    font-family: var(--default-font);
    color: var(--text-color);
    font-weight: bolder;
}

.hidden {
    display: none;
}

.pct50 {
    width: 50%;
    min-width: 256px;
}

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

.column {
    flex-direction: column;
}

.y-aligned {
    justify-content: center;
}

.no-gap {
    gap: 0;
}

.right {
    margin-left: auto;
}

.no-decoration {
    padding-left: 0;
    list-style: none;
}
