/*

Josh's Custom CSS Reset
https://www.joshwcomeau.com/css/custom-css-reset/

*/

*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        interpolate-size: allow-keywords;
    }
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

p {
    text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

#root, #__next {
    isolation: isolate;
}

/*

Progressive font-size

*/

@media (min-width: 576px) {
    html {
        font-size: 106.25%;
    }
}
@media (min-width: 768px) {
    html {
        font-size: 112.5%;
    }
}
@media (min-width: 1024px) {
    html {
        font-size: 118.75%;
    }
}
@media (min-width: 1280px) {
    html {
        font-size: 125%;
    }
}
@media (min-width: 1536px) {
    html {
        font-size: 131.25%;
    }
}

/*

Project design

*/

::selection {
    background-color: #1f6feb;
    color: #fff;
}

body {
    font-family: system-ui, sans-serif;
    height: 100dvh;
    display: grid;
    background-color: #0d1117;
    color: #f0f6fc;
    padding: 1rem;
    gap: 1rem;
}

@media (max-width: 767.98px) {
    body {
        grid-template-rows: 3fr 1fr;
    }
}

@media (min-width: 768px) {
    body {
        grid-template-columns: 1fr 1fr;
    }
}

/* debug */
/* body > section {
    border: 1px solid #F0F;
} */
/* debug */

.source-container,
.output-container {
    display: grid;
    overflow: hidden;
}

.source-container {
    grid-template-rows: auto 1fr auto;
}

.output-container {
    grid-template-rows: auto 1fr;
}

.section-title {
    font-size: .75rem;
    font-weight: bold;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    background-color: #151b23;
    border: 1px solid #3d444d;
    border-bottom: none;
    padding: .5rem .75rem;
}

#source, #output {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
    border: 1px solid #3d444d;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: .5rem .75rem;
    background-color: #0d1117;
    color: currentColor;
    text-wrap: wrap;
    tab-size: 4;
    resize: none;
    overflow: auto;
}

#source:focus {
    border-color: #1f6feb;
    outline: none;
}

#source:focus-visible {
    border-color: #1f6feb;
    box-shadow: inset 0 0 0 2px #1f6feb;
    outline: none;
}

#exec-btn {
    position: relative;
    margin-top: 1rem;
    display: block;
    cursor: pointer;
    padding: 1rem;
    background-color: #238636;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    user-select: none;
}

#exec-btn:hover {
    background-color: #29903b;
}

#exec-btn:active {
    background-color: #2e9a40;
    transform: translateY(2px);
}

#output {
    background-color: #181a1b;
}

.CodeMirror {
    position: relative;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace!important;
    background: none!important;
    height: 100%;
    font-size: 1rem;
    line-height: unset;

    border: 1px solid #3d444d;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.CodeMirror-cursor {
    border-left-color: #fff!important;
}