:root {
    --bg: #fff;
    --text: #000;
    --mimic: #0009; /* stand-in for contrast */
    --minmic: #000;
    --manic: #e55;
    --manmic: #fff;
    --mars: #e83;
    --melt: #dc0;
    --mize: #4ca;
    --miffed: #5be;
    --myrr: #a6e;
    --mora: #fcc;
    --mors: #f09;

    --display: blrr, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --readers: saxmono, Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, system-ui, "Segoe UI", Roboto, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --mono: saxmono, Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
    --border-radius: 15px;
}
[gtheme="light"] {
    --bg: #fff;
    --text: #000;
    --mimic: #0009; /* stand-in for contrast */
    --minmic: #000;
    --manic: #e55;
    --manmic: #fff;
    --mars: #e83;
    --melt: #dc0;
    --mize: #4ca;
    --miffed: #5be;
    --myrr: #a6e;
    --mora: #fcc;
    --mors: #f09;
}
[gtheme="mono-red"] {
    --bg: #c90001;
    --text: #fff;
    --mimic: #fff5;
    --minmic: #fff;
    --manic: #f5cccc;
    --manmic: #fff;
    --mars: #f2aaaa;
    --melt: #f09999;
    --mize: #ef7777;
    --miffed: #e56666;
    --myrr: #fabbbb;
    --mora: #ffcccc;
    --mors: #ca0001;
}
[gtheme="dark"] {
    --bg: #000;
    --text: #eee;
    --mimic: #fff5;
    --minmic: #fff;
    --manic: #f44;
    --manmic: #fff;
    --mars: #f83;
    --melt: #fd3;
    --mize: #4db;
    --miffed: #5af;
    --myrr: #a5f;
    --mora: #dff;
    --mors: #4b9;
}
[gtheme="cataclysm"] {
    --bg: #2c242b;
    --text: #f1a37c;
    --mimic: #fee5;
    --minmic: #fee;
    --manic: #bd1a2a;
    --manmic: #fee;
    --mars: #e64a43;
    --melt: #f1a37c;
    --mize: #760a32;
    --miffed: #b1817d;
    --myrr: #684954;
    --mora: #d5baa2;
    --mors: #170e22;
}
[gtheme="fantastic-planet"] {
    --bg: #f2f5ef;
    --text: #333b8a;
    --mimic: #21132c55;
    --minmic: #21132c;
    --manic: #57b1bc;
    --manmic: #cef;
    --mars: #cfc897;
    --melt: #aa8d44;
    --mize: #7d6a56;
    --miffed: #9371d8;
    --myrr: #9d5644;
    --mora: #b4b2c3;
    --mors: #375e76;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100vh;
    min-width: 100vw;
    color: var(--text);
}

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

@font-face {
    font-family: blrr;
    src: url(fonts/blrrpixs016.ttf);
}

html {
    font-family: var(--readers, sans-serif);
    background: var(--bg);
    scroll-behavior: smooth;
    font-size: 10px;
}

body {
    font-size: 1.6rem;
}

h1 {
    font-size: 4rem;
    text-transform: lowercase;
}

h2 {
    font-size: 2.6rem;
}

h3 {
    font-size: 1.8rem;
}

footer {
    background-color: var(--bg);
    color: var(--text);
    min-height: 300px;
    max-width: 90vw;
    margin: 50px auto 0 auto;
    text-transform: capitalize;
}
.footer {
    display: grid;
    grid: repeat(4,1fr) / 100%;
    .footer-subsection {
        display: grid;
        grid: 100% / 12ch repeat(auto-fit, clamp(12ch, 18ch, 20ch));
        > * {
            padding: 2px 5px;
        }
    }
    .themes > div,
    .settings > div {
        &:hover {
            background-color: var(--mimic);
            color: var(--manmic);
        }
        &:active {
            background-color: var(--manic);
            color: var(--manmic);
        }
    }
    i {
        float: right;
        margin-left: 10px;
        text-align: center;
        margin-top: 0.2rem;
    }
}

a {
    color: var(--mars);
}

a:visited {
    color: var(--miffed);
}

abbr {
    font-style: italic;
    color: var(--manic);
}

code {
    background-color: var(--mora);
    color: var(--mors);
    font-weight: bold;
    font-family: var(--mono, monospace);
}

section {
    padding: 1rem 2rem;
}

ul {
    list-style: circle outside;
    margin-left: 15px;
}

.smallt {
    font-size: 0.8rem;
}

mark.noir {
    background-color: #000;
    color: #fdfdfd;
}

mark.black {
    background-color: #000;
}

mark.white {
    background-color: #fff;
}

mark.goldt {
    color: gold;
}

.boldt {
    font-weight: bold;
}

div#jump-top {
    position: fixed;
    bottom: 15px;
    right: 25px;
    transition: transform ease 180ms;

    &:hover {
        transform: rotate(-5deg);
    }
}

.preface {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: fit-content;
    width: 100%;
    text-align: center;
    margin: 15px 0 50px 0;
    padding: 0 75px;

    h1 {
        color: var(--manic);
        text-shadow: -4px 2px 0 var(--mimic);
        animation: huey 15000ms ease infinite;
    }
}

div.title {
    display: flex;
    flex-direction: row;
    font-family: var(--display);
    
    h1 {
        font-size: 10rem;
    }
}

input#title-color {
    height: 1rem;
    width: 1rem;
    border-radius: 50%;
    border: 2px solid var(--mimic);
    margin: 0;
}

section.catalogue-section h1 {
    font-size: 5rem;
    font-family: var(--readers);
    font-weight: bold;
    filter: blur(1px);

    &::first-letter {
        color: var(--manic);
    }
}

section.catalogue-section {
    height: fit-content;
    width: 100%;
    min-width: 100%;
    max-width: 1000px;
    background: var(--bg);
    padding: 1rem 3rem;
}

.section-container {
    position: relative;
    width: 80%;
    max-width: 1000px;
    margin: 0 auto;
}

section.catalogue-section div.items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

/** **** SECTION IMAGES **** **/
div.images {
    --img-min-width: 160px;
    counter-reset: images;
    display: grid;
    grid: repeat(auto-fit, minmax(0,1fr)) / repeat(auto-fit, minmax(var(--img-min-width),1fr));
    min-width: 100%;
    height: fit-content;
    background-color: #fff;
    border-radius: var(--border-radius);
}

.stationery div.images {
    --img-min-width: 40px;
}
.wallpaper div.images {
    --img-min-width: clamp(230px, 250px, 320px);
    --img-max-height: 180px;
    grid: repeat(auto-fit, minmax(0,1fr)) / repeat(auto-fit, minmax(var(--img-min-width),1fr));
}
.stationery div.images {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    flex-wrap: wrap;
    > div {
        height: unset;
        width: unset;
    }
}
.wallpaper div.images {
    > div {
        height: var(--img-max-height);
        width: auto;
    }
}

div.images img {
    counter-increment: images;
    transition: filter 240ms ease;

    &:hover {
        filter: hue-rotate(-30deg);
    }
}

div.images > div {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.stationery .items div.images div.indc {
    top: 20px;
    right: -10px;
}
.stationery div.images div {
    display: flex;
    align-items: center;
    justify-content: center;
}
.items div.images div.indc {
    position: absolute;
    top: 5px;
    right: 5px;

    &::after {
        display: block;
        content: counter(images);
        border: 1px solid var(--manic);
        border-radius: 50%;
        text-align: center;
        height: 16px;
        width: 16px;
        text-align: center;
        line-height: 16px;
        font-size: 1.2rem;
        font-weight: normal;
        background-color: var(--manic);
        color: var(--manmic);
        position: relative;
        z-index: 2;
    }
}

.stationery img.pen,
img.pen {
    display: inline-block;
    height: 400px;
    width: 40px;
    max-width: 40px;
    object-fit: cover;
}

.music img.artist,
img.album,
img.song {
    display: inline-block;
    min-height: var(--img-min-width);
    min-width: var(--img-min-width);
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.wallpaper img.maxheight {
    height: var(--img-max-height, 200px);
    max-height: var(--img-max-height, 200px);
    width: auto;
    object-fit: cover;
}

/** **** END SECTION IMAGES **** **/

div.addm {
    --max-height: 300px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 10px;
    height: var(--max-height);
    max-height: var(--max-height);
}

div.details {
    counter-reset: details;
    max-height: var(--max-height);
    overflow-y: auto;
}

/** originally within div.details **/
.artist,
.album,
.song {
    a {
        color: inherit;
    }
    &::before {
        content: "[";
    }
    &::after {
        content: "]";
    }
}
.artist {
    color: var(--mars);
}
.album {
    color: var(--melt);
}
.song {
    color: var(--manic);
}

div.details p {
    counter-increment: details;
    display: inline;
}

div.details p::before {
    content: counter(details);
    margin-right: 5px;
    border: 1px solid var(--manic);
    border-radius: 50%;
    display: inline-block;
    height: 16px;
    width: 16px;
    text-align: center;
    line-height: 16px;
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--manmic);
    background-color: var(--manic);
}

/** END (section information) **/
section div.end {
    display: flex;
    flex-direction: column-reverse;
    width: auto;
    word-break: normal;
    padding-top: 20px;

    h1 {
        align-self: flex-end;
        pointer-events: none;
        cursor: default;
        user-select: none;
    }
}


/** **** MECHS **** **/
/** VENDOR **/
.vendor {
    display: flex;
    flex-direction: column;
    align-content: flex-start;
    justify-content: flex-start;
    height: var(--max-height);
    max-height: var(--max-height);
    max-width: 300px;
    min-width: 180px; /* image size */
    flex: 0 0 0;
    padding: 5px;
    border-radius: var(--border-radius);
    border: 2px solid var(--mimic);

    font-size: 1.4rem;
    overflow-y: auto;
    position: relative;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 50%;
}

.vendor:hover {
    .vchaos {
        backdrop-filter: grayscale(1);
    }
    .vended-item * {
        mix-blend-mode: normal;
    }
}

.vendor.closed {
    background-color: var(--mimic);
    color: #fffa;

    details {
        color: inherit;
    }
}

.vendor button:not(:disabled) {
    z-index: 5;
    cursor: pointer;
}

.vendor details {
    color: var(--manic);
    overflow-y: auto;
}

.vglass {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    height: 100%;
    width: 100%;
    overflow: hidden;
    z-index: 5;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    background-color: unset;
}

.vglass.foggy {
    /* animation: foggy 1000ms linear; */
}

@keyframes foggy {
    0% {
        background-color: unset;
        backdrop-filter: blur(0);
    }
    40% {
        background-color: #fffa;
        backdrop-filter: blur(5px);
    }
    100% {
        background-color: unset;
        backdrop-filter: blur(0);
    }
}

.vglass div.post-rain {
    height: 150%;
    width: calc(100% / 6);
    flex-grow: 1;
    transform: translate(0,-100%);
}

div.post-rain {
    &:nth-child(1) {
        background-color: var(--manic);
    }
    &:nth-child(2) {
        background-color: var(--mars);
        /* animation-delay: 200ms; */
    }
    &:nth-child(3) {
        background-color: var(--melt);
        /* animation-delay: 400ms; */
    }
    &:nth-child(4) {
        background-color: var(--mize);
        /* animation-delay: 600ms; */
    }
    &:nth-child(5) {
        background-color: var(--miffed);
        /* animation-delay: 800ms; */
    }
}

.vchaos {
    height: 100%;
    width: 100%;
    border-radius: var(--border-radius);
    position: absolute;
    top: 0;
    left: 0;
    transition: backdrop-filter 300ms ease;
}

.vendor details div > * {
    display: inline;
}

.vbuttons {
    display: flex;
    flex-direction: row;
    gap: 2px;
    > * {
        flex: 1 0 0;
    }
}

.vendor-rand {
    min-height: 30px;
    min-width: 30px;
    background-color: var(--manic);
    border-radius: 16px;
    border: 2px solid var(--manic);
    padding: 2px;
    font-family: var(--mono, monospace);

    transition: filter linear 400ms;
}

.vendor-rand:disabled {
    background-color: var(--mimic);
    border-color: var(--mimic);
    color: #fffa;
}

.vendor-rand:not(:disabled):hover {
    filter: saturate(1.7);
}

.vended-item > * {
    color: var(--manic);
    mix-blend-mode: difference;
    filter: contrast(1.5);
    font-weight: bold;
    /* animation: huey 5000ms linear infinite; */
}

@keyframes huey {
    0% {
        color: var(--manic);
    }
    35% {
        color: var(--melt);
    }
    60% {
        color: var(--miffed);
    }
    85% {
        color: var(--mora);
    }
    100% {
        color: var(--manic);
    }
}

/** **** END MECHS **** **/

/** timeline **/
.timeline {
    display: flex;
    position: relative;
    flex-direction: column;
    height: fit-content;
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    gap: 30px;
}

div#timeweave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 100%;
    width: 26px;
    background: linear-gradient(var(--bg) 30px, var(--mora), var(--bg) calc(100% - 30px));
}

.timed {
    position: relative;
    min-height: 50px;
    padding: 2px 5px;
    max-width: 47%;
}

.timed::before {
    content: "✦";
    position: absolute;
    top: calc(50% - 15px);
    height: 30px;
    width: 30px;
    font-size: 30px;
    line-height: 30px;
    color: var(--bg);
    text-shadow: 0 0 5px var(--mora);
}

.timed:nth-child(2) {
    margin-top: 50px;
}
.timed:last-child {
    margin-bottom: 50px;
}

.timed:nth-child(n) {
    align-self: flex-end;

    &::before {
        left: calc(0px - 100% + 94% - 14px);
        right: unset;
    }
}

.timed:nth-child(2n) {
    align-self: flex-start;

    &::before {
        left: unset;
        right: calc(0px - 100% + 94% - 20px);
    }
}

time {
    border: 1px solid var(--text);
    margin-right: 5px;
}

/** end timeline **/

/** images **/
img.smallbox {
    height: 200px;
    width: 200px;
    object-fit: contain;
}

img.r90d {
    transform: rotate(90deg);
}
/** end images **/

footer .themes,
footer .settings {
    cursor: default;
}

#butler {
    position: absolute;
    left: 0;
    top: 0;
    height: 100vh;
    width: 100vw;
    background: var(--bg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;

    div {
        max-width: 70%;
    }
    .title {
        font-size: 3rem;
    }
    button {
        padding: 0 3px;
        border-radius: 0;
        border: 2px solid var(--mimic);
        font-family: var(--mono, monospace);
        background-color: var(--bg);
        cursor: pointer;
        color: var(--text);
        &:hover {
            background-color: var(--mimic);
            color: var(--manmic);
        }
    }
}

#butler-menu {
    margin-top: 15px;
    span {
        font-weight: bold;
        color: var(--manic);
    }
    button {
        border: 2px solid var(--mimic);
        background-color: var(--manic);
        color: var(--minmic);
        &:hover {
            background-color: var(--mimic);
            color: var(--manmic);
        }
    }
}

#gsign {
    background: url('https://t3.ftcdn.net/jpg/14/57/78/46/360_F_1457784677_0gmbcu9EWsC6gCZ3RLpsb31RHJD8ERTt.png') center / contain no-repeat;
    position: absolute;
    top: 0;
    left: 0;
    height: 140px;
    width: 250px;
    display: grid;
    grid: 40px 60px 40px / 100%;
}
#gnotice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    grid-area: 2 / 1 / 3 / 2;
    color: hsl(20, 50%, 25%);
    font-weight: bold;
    font-family: var(--display);
    font-size: 18px;
    text-shadow: -1px -1px 2px hsl(24, 50%, 60%);
}

.mezlock {
    display: inline-block;
    border: 2px solid var(--melt);
    border-radius: 50%;
    background-color: var(--manic);
    height: 59px;
    width: 59px;
    min-height: 5px;
    min-width: 5px;
    position: relative;
    

    > .mezlock {
        height: 51px;
        width: 51px;
        background-color: var(--mize);
        border: 2px solid var(--melt);
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        /* animation: 5000ms mezulock-pulse ease infinite normal; */

        > .mezlock {
            height: 39px;
            width: 39px;
            background-color: var(--manic);
            border: 2px solid var(--melt);
            position: relative;
            /* animation: none; */
            
            > .mezlock {
                background-color: var(--mars);
                border: 2px solid var(--melt);
                height: 25px;
                width: 25px;
                /* animation: 5000ms mezulock-pulse ease infinite normal; */
            }
            > div:not(.mezlock) {
                height: 30px;
                width: 30px;
                position: absolute;
                top: 50%;
                left: 50%;
                margin: auto;
                transform-origin: top left;
                transform: rotate(0) translate(-50%, -50%);
                /* animation: 3000ms mezulock-stagger linear infinite normal; */
            }
            > div .mezlock:nth-child(1) {
                height: 15px;
                width: 15px;
                background-color: var(--miffed);
                border: 2px solid var(--melt);
                border-radius: 0 0 0 100%;
                position: absolute;
                left: 0;
                top: 15px;
                /* animation: none; */
            }
            > div .mezlock:nth-child(2) {
                height: 15px;
                width: 15px;
                background-color: var(--miffed);
                border: 2px solid var(--melt);
                border-radius: 0 100% 0 0;
                position: absolute;
                left: 15px;
                top: 0;
                /* animation: none; */
            }
        }
    }
}

@keyframes mezulock-stagger {
    0% {
        transform: rotate(0deg) translate(-50%, -50%);
    }
    40% {
        transform: rotate(160deg) translate(-50%, -50%);
    }
    60% {
        transform: rotate(160deg) translate(-50%, -50%);
    }
    80% {
        transform: rotate(270deg) translate(-50%, -50%);
    }
    100% {
        transform: rotate(360deg) translate(-50%, -50%);
    }
}

@keyframes mezulock-pulse {
    0% {
        background-color: var(--mize);
    }
    30% {
        background-color: var(--mors);
    }
    60% {
        background-color: var(--myrr);
    }
    100% {
        background-color: var(--mize);
    }
}

@media only screen and (max-width: 1100px) {
    #gsign {
        visibility: hidden;
    }
}
@media only screen and (max-width: 992px) {
    body {
        font-size: 1.4rem;
    }
    .footer {
        grid: 100% / repeat(4,1fr);
        .footer-subsection {
            display: grid;
            grid: repeat(auto-fit, 1.6em) / 100%;
            > * {
                padding: 2px 5px;
            }
            >:nth-child(1) {
                font-weight: bold;
            }
        }
    }
    .smallt {
        font-size: 1rem;
    }
    section.catalogue-section h1 {
        font-size: 4rem;
    }
    div.images {
        --img-min-width: 120px;
    }
    .stationery div.images {
        --img-min-width: 30px;
    }
    .stationery img.pen,
    img.pen {
        height: 300px;
        min-width: var(--img-min-width);
        max-width: 30px;
        object-fit: cover;
    }
    img.smallbox {
        height: 130px;
        width: 130px;
    }
    .wallpaper div.images {
        --img-min-width: 200px;
        --img-max-height: 160px;
    }
    div.details {
        font-size: 1.4rem;
    }
    div#timeweave {
        width: 16px;
    }
    .timed::before {
        top: calc(50% - 8px);
        height: 24px;
        width: 24px;
        font-size: 24px;
        line-height: 24px;
        text-shadow: 0 0 5px var(--mora);
    }
    .timed:nth-child(n)::before {
        left: calc(0px - 100% + 94% - 11px);
    }
    .timed:nth-child(2n):before {
        left: unset;
        right: calc(0px - 100% + 94% - 16px);
    }
    .timed {
        font-size: 1.4rem;
    }
}

@media only screen and (max-width: 768px) {
    footer {
        font-size: 1.4rem;
    }
    section.catalogue-section h1 {
        font-size: 3.2rem;
    }
    div.addm {
        --max-height: 250px;
    }
    .vendor {
        font-size: 1.1rem;
        min-width: 150px;
    }
    .vendor-rand {
        min-height: 15px;
        min-width: 30px;
        background-color: var(--manic);
        padding: 2px;
    }
    .vendor details {
        font-size: 1.1rem;
    }
    div.title {
        h1 {
            font-size: 7rem;
        }
    }
    .section-container {
        width: clamp(550px, 88%, 95%);
    }
    div.images {
        --img-min-width: 100px;
    }
    .items div.images div.indc::after {
        height: 1.4em;
        width: 1.4em;
        text-align: center;
        line-height: 1.4em;
        font-size: 1rem;
    }
    .stationery div.images {
        --img-min-width: 25px;
    }
    .stationery img.pen,
    img.pen {
        height: 270px;
        min-width: var(--img-min-width);
        max-width: 30px;
    }
    img.smallbox {
        height: 130px;
        width: 130px;
    }
    .wallpaper div.images {
        --img-min-width: 180px;
        --img-max-height: 130px;
    }
    div.details {
        font-size: 1.2rem;
    }
    div.details p::before {
        margin-right: 3px;
        height: 1.4em;
        width: 1.4em;
        line-height: 1.4em;
        font-size: 1rem;
    }
    .timeline {
        width: 95%;
    }
    .timed {
        font-size: 1.3rem;
    }
}
@media only screen and (max-width: 600px) {
    :root {
        --border-radius: 10px;
    }
    footer {
        font-size: 1.2rem;
    }
    .footer {
        grid: repeat(2,1fr) / repeat(2, 1fr);
    }
    .vendor {
        padding: 3px;
    }
    .vendor details {
        font-size: 1.2rem;
    }
    .vendor-rand {
        min-height: none;
        font-size: 1.2rem;
        padding: 1px;
    }
    .preface {
        padding: 0 20px;
    }
    div.title {
        h1 {
            font-size: 4rem;
            text-shadow: -2px 1px 0 var(--mimic);
        }
    }
    .section-container {
        width: max(300px, 94%);
        margin-bottom: 25px;
    }
    section.catalogue-section {
        padding: 0;
    }
    div.images {
        padding: 0;
    }
    .stationery div.images {
        --img-min-width: 20px;
    }
    .stationery img.pen,
    img.pen {
        height: 180px;
        min-width: var(--img-min-width);
        max-width: 20px;
    }
    img.smallbox {
        height: 90px;
        width: 90px;
    }
    .wallpaper div.images {
        --img-min-width: 130px;
        --img-max-height: 100px;
    }
    .stationery .items div.images div.indc {
        top: 5px;
        right: -10px;
    }
    div.addm {
        --max-height: 240px;
    }
    div.details {
        font-size: 1.4rem;
    }
    #jump-top {
        visibility: hidden;
    }
}
@media only screen and (max-width: 400px) {
    body {
        font-size: 1.1rem;
    }
}