/* @import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap'); */
/* ^ replaced with local copy of source code pro in /fonts */

/* fonts */

@font-face {
    font-family: "Source Code Pro";
    src: url("fonts/source-code-pro/SourceCodePro-VariableFont_wght.ttf") format("truetype");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Code Pro";
    src: url("fonts/source-code-pro/SourceCodePro-Italic-VariableFont_wght.ttf") format("truetype");
    font-weight: 200 900;
    font-style: italic;
    font-display: swap;
}

/* global */

:root {
    --foreground: #CAD3F5;
    --background: #24273A;

    --foreground50: #CAD3F580;
    --background50: #24273A80;

    --foreground75: #CAD3F5BF;
    --background75: #24273ABF;

    --foreground85: #CAD3F5D9;
    --background85: #24273AD9;

    --foreground95: #CAD3F5F2;
    --background95: #24273AF2;

    --foreground99: #CAD3F5FC;
    --background99: #24273AFC;

    --active: #F5A97F;

    --selection-foreground: #24273A;
    --selection-background: #F4DBD6;

    --cursor: #F4DBD6;
    --cursor-text-color: #24273A;

    --url-color: #F4DBD6;

    --font: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html,
body {
    padding: 0;
    margin: 0;

    height: 100%;

    font-family: var(--font);
    font-size: 1rem;

    color: var(--foreground);
    background-color: var(--background);

    background-image: url("images/other_bg.edited.webp");
    background-position: right;
    background-size: contain;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body {
    display: flex;

    flex-direction: row;
    gap: 0;
}

::selection {
    color: var(--selection-foreground);
    background-color: var(--selection-background);
}

::-moz-selection {
    color: var(--selection-foreground);
    background-color: var(--selection-background);
}

h1,
h2,
h3,
h4,
h5,
h6,
small,
p,
a {
    padding: 0;
    margin: 0;
}

a {
    color: var(--foreground);

    text-decoration: none;
    border: 1px dashed transparent;

    cursor: crosshair;
}

a:hover {
    border: 1px dashed var(--url-color);
}

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

.unselectable {
    -webkit-touch-callout: none;
    /* iOS Safari */
    -webkit-user-select: none;
    /* Safari, Chrome, Opera */
    -khtml-user-select: none;
    /* Konqueror HTML */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* Internet Explorer/Edge */
    user-select: none;
    /* Non-prefixed version, currently supported in all modern browsers */
}

.sidebar {
    position: fixed;

    top: 0;
    left: 0;

    width: 20%;
    height: 100vh;

    padding: 1rem;

    color: var(--background);
    background-color: var(--foreground50);

    box-sizing: border-box;

    overflow: auto;

    margin: 0;

    z-index: 10;
}

.app {
    position: relative;

    padding: 1rem;
    padding-right: 33%;

    overflow-wrap: anywhere;

    height: fit-content;

    flex: 1;
    display: flex;
    flex-direction: column;

    margin-left: calc(20% + 1rem);
}

.greeting {
    margin-left: 2rem;
    margin-right: 2rem;

    width: fit-content;
}

.greeting h1 {
    display: inline-flex;

    align-items: baseline;

    gap: 0.125rem;
}

.cursor {
    display: inline-block;
}

.cursor::after {
    content: "_";

    color: var(--cursor);

    animation: blinker 1s step-end infinite;
}

.subtext {
    font-weight: 200;
    font-size: 0.75rem;
    opacity: 0.75;
}

.keyword {
    color: var(--active);
}

.active::before {
    content: "> ";
}

/* index */

.container {
    margin: auto;
}

.warning {
    padding: 2rem;
    margin: auto;

    width: 25%;

    border: 2px dashed var(--active);
}

#continue {
    padding: 0.125rem;
    margin: 0 auto;

    padding-left: 2rem;
    padding-right: 2rem;

    margin-top: -1rem;

    width: fit-content;

    transform: rotate(0) scale(1) skew(0deg, 0deg);

    font-size: 1.5rem;

    text-align: center;

    color: var(--background);
    background-color: var(--foreground);

    cursor: crosshair;
}

/* landing */

.hello {
    display: inline-block;

    white-space: nowrap;
    overflow: hidden;

    animation: typing 1.25s steps(8, end);
}

#name {
    display: inline-block;

    border: 1px dashed transparent;

    font-style: italic;

    transition: font-weight 125ms ease-in-out;
}

#name:hover {
    font-weight: 800;

    border: 1px dashed var(--active);

    cursor: crosshair;
}

#name::after {
    display: inline-block;

    content: "←";

    padding-left: 0.5rem;

    transform: translateX(0rem);

    transition: transform 125ms ease-in-out;
}

#name:hover::after {
    transform: translateX(-0.25rem);
}

#about-modal {
    position: fixed;
    inset: 2rem;
    margin: auto auto;

    width: 75%;
    height: 75%;

    display: none;

    padding: 1rem;
    box-sizing: border-box;

    opacity: 0;
    transform: scale(0.95);

    pointer-events: none;

    background-color: var(--background95);
    background-image: url("images/noise.png");
    background-position: 50% 50%;
    background-repeat: repeat;

    border: 2px dashed var(--active);

    z-index: 99;
    overflow: auto;
}

#about-modal.is-open {
    display: block;

    pointer-events: auto;

    animation: popup 250ms ease-out forwards;
}

#about-modal.is-closing {
    display: block;

    pointer-events: none;

    animation: popout 250ms ease-out forwards;
}

#about-modal .text {
    position: absolute;

    top: 1rem;
    left: 1rem;

    display: flex;

    flex-direction: column;

    z-index: 99;
}

#about-modal p {
    display: flex;

    flex-direction: row;
}

#close {
    position: absolute;

    top: 2rem;
    right: 2rem;

    cursor: crosshair;

    margin: 0;
    padding: 0;

    z-index: 999;
}

#close svg {
    width: 1.5rem;
    height: 1.5rem;
}

#about-modal .img {
    position: absolute;

    top: 50%;
    right: 1rem;
    transform: translateY(-50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;

    max-height: 90%;
    z-index: 9;
}

#about-modal .img img {
    width: auto;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

#about-modal .img p {
    justify-content: center;
    text-align: center;
}

/* about */

.about {
    display: inline-block;

    white-space: nowrap;
    overflow: hidden;

    animation: typing 1.25s steps(10, end);
}

/* credits */

.credits {
    display: inline-block;

    white-space: nowrap;
    overflow: hidden;

    animation: typing 1.25s steps(8, end);
}

/* animations */

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinker {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes popup {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popout {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* scrollbar (only works on new browsers i think) */

::-webkit-scrollbar {
    width: 0.125rem;
}

::-webkit-scrollbar-track {
    background: var(--foreground50);
}

::-webkit-scrollbar-thumb {
    background: var(--active);
}