:root {
    --crt-red: rgb(218, 49, 49);
    --crt-green: rgb(131, 211, 136);
    --crt-blue: rgb(40, 129, 206);
}

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgb(131, 211, 136) rgb(25, 25, 30);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgb(25, 25, 30); }
::-webkit-scrollbar-thumb {
    background: rgb(131, 211, 136);
    box-shadow: 0 0 4px rgb(131, 211, 136);
}
::-webkit-scrollbar-corner { background: rgb(25, 25, 30); }

/* Global */
body {
    background-color: black;
    overflow: hidden;
}
html {
    font-size: clamp(0.75rem, 1.5vw, 1.5rem);
    font-family: "Courier New", monospace;
    height: 100%;
    overflow: hidden;
}
main {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    color: rgba(131, 211, 136, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.green {
    color: rgb(131, 211, 136);
}
.yellow {
    color: rgb(255, 255, 111);
}
.lightblue {
    color: lightblue;
}
.wrapper {
    padding-top: 2rem;
    padding-left: 1rem;
    flex: 1;
    overflow-y: auto;
}
.wrapper div { min-height: 1.2em; }
.code {
    animation: typewriter 1s steps(14) 1s 1 normal both;
    line-height: 1;
    margin: 0;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
}
.code-line {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.5;
    animation: typewriter 1s steps(14) both;
}
.cursor {
    display: inline-block;
    animation: blinkTextCursor 500ms infinite normal;
}

/* Animation */
@keyframes typewriter {
    from { width: 0; }
    to   { width: 100%; }
}
@keyframes blinkTextCursor {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Status bar */
.statusbar {
    background-color: rgb(131, 211, 136);
    color: rgb(25, 25, 30);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

/* Menu — vertical (used on landing/index pages) */
.menu {
    padding-left: 1rem;
    margin-top: 1rem;
}
.menu-spacer {
    line-height: 1.5;
}
.menu-item {
    cursor: pointer;
    line-height: 1.5;
    white-space: nowrap;
    display: block;
    overflow: hidden;
    animation: typewriter 1s steps(14) both;
}
.menu-line {
    display: inline-grid;
    grid-template-columns: 3ch 14ch 1fr;
    align-items: baseline;
}
.menu-item.selected .menu-line {
    background-color: rgb(131, 211, 136);
    color: rgb(25, 25, 30);
}

@media (max-width: 600px) {
    .menu-item {
        white-space: normal;
        height: auto;
    }
    .menu-line {
        grid-template-columns: 3ch 1fr;
        grid-template-rows: auto auto;
    }
    .menu-desc {
        grid-column: 2;
        grid-row: 2;
    }
}

/* Nav bar — horizontal, pinned to bottom of main */
nav.menu {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    padding: 0.25rem 0 0.75em 0;
    margin-top: 0;
}
nav.menu .menu-item {
    flex: 1;
    text-align: center;
    animation: none;
    overflow: visible;
    white-space: nowrap;
    display: block;
}
nav.menu .menu-blank {
    flex: 1;
}
nav.menu .menu-spacer { display: none; }
nav.menu .menu-line { display: inline-grid; grid-template-columns: auto auto; }
nav.menu .menu-desc { display: none; }
nav.menu .menu-key {
    background-color: rgb(131, 211, 136);
    color: rgb(25, 25, 30);
    text-shadow: none;
}
nav.menu .menu-item:hover,
nav.menu .menu-item:focus {
    background-color: rgb(131, 211, 136);
    color: rgb(25, 25, 30);
    text-shadow: none;
    cursor: pointer;
    outline: none;
}
nav.menu .menu-item:hover .menu-key,
nav.menu .menu-item:focus .menu-key {
    background-color: rgb(25, 25, 30);
    color: rgb(131, 211, 136);
}

/* Memo list rows */
.memo-row {
    cursor: pointer;
    outline: none;
}
.memo-row:hover,
.memo-row:focus {
    background-color: rgb(131, 211, 136);
    color: rgb(25, 25, 30);
    text-shadow: none;
}
.memo-row:hover span.green,
.memo-row:focus span.green,
.memo-row:hover span.yellow,
.memo-row:focus span.yellow {
    color: inherit;
}

/* CRT effect */
.crt {
    background-color: rgb(25, 25, 30);
    text-shadow:
        0 0 0.1em currentColor,
        0 0 0.4em currentColor,
        0 0 1em currentColor;
    position: relative;
    &:before,
    &:after {
        content: "";
        transform: translateZ(0);
        pointer-events: none;
        opacity: 0.8;
        mix-blend-mode: overlay;
        position: absolute;
        height: 100%;
        width: 100%;
        left: 0;
        top: 0;
        z-index: 1;
    }

    &:before {
        background: repeating-linear-gradient(
            var(--crt-red) 0px,
            var(--crt-green) 2px,
            var(--crt-blue) 4px
        );
    }
    &:after {
        background: repeating-linear-gradient(
            90deg,
            var(--crt-red) 1px,
            var(--crt-green) 2px,
            var(--crt-blue) 3px
        );
    }
}
