@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100..800&family=Wix+Madefor+Text:wght@400..800&display=swap");


:root {
    --space-xs: 0.75rem;
    --space-s: 1rem;
    --space-m: 2rem;
    --space-l: 3rem;

    --color-primary: #FFB400;
    --color-primary-dim: #684F17;
    --color-bg: #080F0F;
    --color-bg-dim: #383B3B;
    --color-bg-light: #FFFFFF;
    --color-bg-translucent: #080F0F40;
    --color-bg-error: #473832;
    --color-fg: #FFFFFF;
    --color-fg-dark: #202222;
    --color-fg-dim: #C8CCCC;
    --color-fg-error: #F5C5B5;
    --color-fg-code: #C7EFCF;
}


* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--color-bg) transparent;
}

*:focus, *:focus-visible {
    outline: none;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

html {
    font-family: "Wix Madefor Text", sans-serif;
    font-size: 14px;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--color-bg);
    color: var(--color-fg);
}

body:not(.ready) main {
    opacity: 0;
    pointer-events: none;
}

header,
main,
footer {
    width: 100%;
    padding: var(--space-s);
}

header,
footer {
    flex: 0 0 auto;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-l);
}

header nav {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

main {
    display: grid;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    border-block: 2px solid var(--color-bg-dim);
    transition: opacity 200ms;
}

section {
    display: flex;
    flex-direction: column;
}

h1, h2,
p {
    margin: 0;
}

h1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.125rem;
}

h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
}

p + p {
    margin-top: var(--space-xs);
}

small {
    font-size: 0.85em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

ul, ol {
    margin: 0;
    padding: 1em;
}

table {
    width: max-content;
    transform: translateY(-0.2em);
}

table td {
    min-width: max-content;
    white-space: nowrap;
    padding-right: var(--space-s);
}

table tr:not(:last-child) td {
    padding-bottom: var(--space-xs);
}

form {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--space-m);
}

form section {
    gap: var(--space-s);
}

label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

textarea, input {
    margin: 0;
    border: none;
    background-color: var(--color-bg-dim);
    color: var(--color-fg);
    font-family: "JetBrains Mono", monospace;
    font-size: inherit;
}

textarea {
    resize: none;
    flex: 1 1 0;
    padding: 1em 1.25em;
    width: 100%;
    height: 100%;
    min-width: 0;
    font-size: 0.8em;
    line-height: 1.75;
    transition: box-shadow 200ms;
}

textarea:not([readonly]):focus {
    box-shadow: inset 0 0 0.5rem -0.25rem var(--color-primary);
}

textarea.error {
    background-color: var(--color-bg-error);
    color: var(--color-fg-error);
}

input {
    padding: 0.25em 0.5em;
    width: 7.5rem;
}

input[type="range"] {
    width: 100%;
    min-width: 0;
    height: 0.3em;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--color-bg-dim);
    cursor: pointer;
    vertical-align: middle;
}

input[type="range"]::-webkit-slider-thumb {
    width: 1em;
    height: 1em;
    border: none;
    border-radius: 0.3em;
    background-color: var(--color-primary);
    appearance: none;
    -webkit-appearance: none;
}

input[type="range"]::-moz-range-thumb {
    width: 1em;
    height: 1em;
    border: none;
    border-radius: 0.3em;
    background-color: var(--color-primary);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
}

input[type="checkbox"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    padding: 0;
    appearance: none;
    border: 2px solid var(--color-primary);
    border-radius: 0.2rem;
    background-color: transparent;
    cursor: pointer;
}

input[type="checkbox"]:checked {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
}

input[type="checkbox"]:checked::after {
    content: "⨯";
    display: block;
    color: var(--color-fg-dark);
    font-size: 1.125em;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-0.0125em);
}

canvas {
    display: block;
    flex: 1 1 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

code,
output {
    color: var(--color-fg-code);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.95em;
}

p code {
    font-size: 0.925em;
}

hr {
    margin: 0;
    width: 100%;
    height: 2px;
    border: none;
    background-color: var(--color-bg-dim);
}

iframe + hr {
    margin: var(--space-xs) 0;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: var(--color-bg-light);
}

.no-select {
    pointer-events: none;
    user-select: none;
}

.float {
    position: absolute;
    bottom: 0;
    margin: var(--space-s);
}

.float--l {
    left: 0;
}

.float--r {
    right: 0;
}

.flex {
    display: flex;
    align-items: center;
    gap: var(--space-m);
}

.flex--between {
    justify-content: space-between;
}

.flex--s {
    gap: var(--space-s);
}

.flex--xs {
    gap: var(--space-xs);
}

.flex-space {
    flex: 1 0 0;
}

.text-s {
    font-size: 0.8em;
}

.text-l {
    font-size: 1.15em;
}

.text-dim {
    color: var(--color-fg-dim);
}

.text-primary {
    color: var(--color-primary);
}

.nowrap {
    white-space: nowrap;
}

.button {
    cursor: pointer;
    display: inline-flex;
    flex-direction: row;
    align-self: flex-start;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.5em 1em;
    background-color: var(--color-primary);
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-fg-dark);
    border: none;
    border-radius: 0.3em;
    outline: none;
}

.button:hover {
    filter: brightness(0.8);
}

.button--s {
    font-size: 0.7em;
}

.button--l {
    font-size: 1em;
}

.button--dim {
    background-color: var(--color-primary-dim);
    color: var(--color-fg);
}

.button--light {
    background-color: var(--color-fg);
}

.button[data-snapshot]::before {
    content: "📋";
}

.button img {
    height: 1.125em;
    margin: 0;
}

.tabs {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 10rem;
    min-height: 0;
}

.tabs--outline {
    border: 2px solid var(--color-bg-dim);
}

.tabs-header {
    display: flex;
    border-top: 2px solid var(--color-bg-dim);
}

.tabs-header button {
    margin: 0.25em;
    padding: 0.5em 1em;
    border: none;
    border-radius: 0.3em;
    background-color: transparent;
    color: var(--color-fg);
    font-size: 1rem;
    cursor: pointer;
}

.tabs-header button:hover,
.tabs-header button.active {
    background-color: var(--color-bg-dim);
}

.tabs--s .tabs-header button {
    font-size: 0.9rem;
}

.tabs-body {
    position: relative;
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    min-width: 0;
    min-height: min-content;
    height: auto;
    overflow: auto;
}

.tabs-body > *:not(.active) {
    display: none !important;
}

.panel {
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    border: 2px solid var(--color-bg-dim);
    overflow: hidden;
}

.content {
    position: relative;
    height: 100%;
}

.content--split {
    display: flex;
    flex-direction: column !important;
    flex: 1 0 auto;
}

.card {
    flex: 0 0 auto;
    padding: var(--space-s);
    overflow: auto;
}

.copy-button, .clear-button {
    position: absolute;
    margin: var(--space-s);
    top: 0;
    right: 0;
    opacity: 0;
    transition: opacity 200ms;
}

.clear-button {
    top: auto;
    bottom: 0;
}

.close-button {
    cursor: pointer;
    position: relative;
    margin-left: auto;
    padding: 0;
    flex: 0 0 auto;
    width: 0.75rem;
    height: 0.75rem;
    background-color: transparent;
    color: var(--color-fg-dim);
    border: none;
    outline: none;
}

.close-button::before,
.close-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 2px;
    background-color: currentColor;
}

.close-button::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-button::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.close-button:hover {
    color: var(--color-primary);
}

*:hover + .copy-button,
*:hover + .clear-button,
.copy-button:hover,
.clear-button:hover {
    opacity: 1;
}

.tooltip {
    cursor: help;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.85em;
    height: 0.85em;
    color: var(--color-fg-dim);
    text-align: center;
    border: 0.75px solid var(--color-fg-dim);
    border-radius: 100%;
}

.tooltip:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.tooltip--highlight {
    animation-name: blink;
    animation-duration: 1500ms;
    animation-iteration-count: 3;
}

.tooltip::before {
    content: "i";
    font-size: 0.5em;
    font-weight: 700;
    line-height: 1;
}

@keyframes blink {
    0%, 100% {
        color: var(--color-fg-dim);
        border-color: var(--color-fg-dim);
        transform: scale(1);
    }
    50% {
        background-color: var(--color-primary);
        color: var(--color-bg);
        border-color: var(--color-primary);
        transform: scale(1.35);
    }
}

.tooltip-content {
    cursor: default;
    white-space: normal;
    position: fixed;
    inset: auto;
    margin: 0;
    padding: 0.75rem 1rem;
    max-width: 33rem;
    background-color: var(--color-bg);
    color: var(--color-fg);
    font-size: 1rem;
    font-weight: 400;
    text-align: left;
    text-align: justify;
    line-height: 1.5;
    border: 1px solid var(--color-primary);
}

.tooltip-content::backdrop {
    background-color: var(--color-bg-translucent);
    backdrop-filter: blur(1px);
    pointer-events: none;
}

.resizer {
    position: relative;
    flex: 0 0 var(--space-s);
    cursor: col-resize;
    touch-action: none;
}

.resizer::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background-color: var(--color-bg-dim);
    content: "";
    transform: translateX(-50%);
    transition: width 100ms, background-color 200ms;
}

.resizer:hover::before {
    background-color: var(--color-primary);
}

.hide {
    display: none !important;
}

.hide-l {
    display: none !important;
}


@media (max-width: 920px) {
    html {
        overflow-y: auto;
        font-size: 12px;
    }

    body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    main {
        display: flex;
        flex: 1 0 auto;
        flex-direction: column;
        min-height: 0;
        gap: var(--space-s);
        overflow: visible;
    }

    textarea,
    canvas {
        flex: 1 1 auto;
        min-height: 60vh;
        height: 100%;
    }

    form {
        flex-direction: column;
        gap: var(--space-s);
    }

    iframe {
        min-height: 40vh;
    }

    .button {
        justify-content: center;
    }

    .tabs {
        min-height: auto;
    }

    .panel {
        display: block;
        width: 100%;
        max-height: none;
        overflow: hidden;
    }

    .content {
        display: flex;
        flex-direction: row;
        gap: 0;
    }

    .content::after {
        content: "";
        display: block;
        width: var(--space-m);
        background-color: var(--color-bg-dim);
        background-image: radial-gradient(circle, var(--color-bg) 1px, transparent 1px);
        background-position: center;
        background-size: 4px 4px;
    }

    .tooltip {
        width: 1em;
        height: 1em;
    }

    .tooltip::before {
        font-size: 0.75em;
    }

    .resizer {
        display: none;
    }

    .hide-s {
        display: none !important;
    }

    .hide-l {
        display: block !important;
    }
}