@font-face {
    font-family: "Epoch";
    src: url("static/epoch.otf") format("opentype");
}

:root {
    --background: #1d1d1d;
    --on-background: #272727;
    --floating: #363636;
    --foreground: #fff8e7;
    --low-contrast: var(--on-background);
    --caret: var(--foreground);
    --editor-background: #282c34;
    --editor-border-radius: 1rem;
    --editor-gaps: 1rem;
    --terminal-background: black;
    --error: red;
}

html {
    height: 100%;
}

body {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
    color: var(--foreground);
}

header {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    font-family: "Epoch", sans-serif;
    display: flex;
    justify-content: space-between;
}

header img {
    height: 1.25rem;
}

#app {
    flex: 1;
    display: flex;
    gap: var(--editor-gaps);
}

#editors,
#output {
    width: 100%;
    max-width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--editor-gaps);
}

#output > article {
    height: 100%;
}

#patchContainer,
#codeContainer,
#patchedCodeContainer {
    background-color: var(--editor-background);
}

#options {
    padding-left: 1rem;
    padding-top: 1rem;
}

.layered {
    display: grid;
    height: 100%;
}

.layered > * {
    grid-column-start: 1;
    grid-row-start: 1;
}

.layered > textarea {
    border: none;
    background-color: transparent;
    color: transparent;
    caret-color: var(--foreground);
    z-index: 1;
    padding: 1em;
    font-size: 14px;
    font-family: var(--bs-font-monospace);
    line-height: var(--bs-body-line-height);
}

code {
    height: 100%;
}

textarea {
    resize: none;
}

#terminal {
    padding: 1rem;
    background-color: var(--terminal-background);
    color: var(--low-contrast);
    overflow: scroll;
    height: max-content;
}

#terminal.error {
    color: var(--error);
    border-left: 2px solid var(--error);
    border-top: 2px solid var(--error);
}

pre {
    margin-bottom: 0;
}

#patchContainer,
#patchDisplay {
    border-top-right-radius: var(--editor-border-radius);
    border-bottom-right-radius: var(--editor-border-radius);
}

#codeContainer,
#codeDisplay {
    border-top-right-radius: var(--editor-border-radius);
}

#patchedCodeContainer {
    border-top-left-radius: var(--editor-border-radius);
    border-bottom-left-radius: var(--editor-border-radius);
}

#output > :nth-child(2) {
    border-top-left-radius: var(--editor-border-radius);
}

@media (max-width: 80ch) {
    #app {
        flex-direction: column;
        margin: 0.5rem;
    }

    #patchContainer,
    #patchDisplay,
    #codeContainer,
    #codeDisplay,
    #patchedCodeContainer,
    #patchedCode {
        border-radius: var(--editor-border-radius);
    }

    #output > :nth-child(2) {
        border-top-right-radius: var(--editor-border-radius);
    }
}
