:root {
    --color: #e71825;
}

html,
body {
    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;

    background-color: black;
    color: white;

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        'Open Sans',
        'Helvetica Neue',
        sans-serif;

    &:has(.a.active) {
        --color: #ff7171;
    }
}

* {
    font-family: inherit;
    box-sizing: border-box;
}

#textarea {
    padding: 0;
    margin: 0;

    border: none;
    width: 100%;
    flex: 1;

    resize: none;
    outline: none;

    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    line-height: 1.45;

    font-family: Normal, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;

    :has(#previewToggle:not(.active)) & {
        font-size: 30px;
        line-height: 1.1;
    }
    
    :has(#previewToggle.active) & {
        font-family: 'Automaton';
    }

    :has(.normal.active) & {
        background-color: black;
        color: var(--color);
    }

    :has(.invert.active) & {
        background-color: var(--color);
        color: black;
    }
}

section {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 32px;

    user-select: none;

    border-top: solid 1px rgba(255, 255, 255, 0.1);
}

.toggle {
    display: flex;
    gap: 8px;
    align-items: center;

    p {
        margin: 0;
    }
}

#previewToggle {
    width: 44px;
    height: 24px;
    border-radius: 6px;
    border: none;

    padding: 3px;

    background-color: #242424;

    &:hover {
        background-color: #303030;

        div {
            background-color: #565656;
            width: 22px;
        }
    }

    &.active {
        background-color: var(--color);

        div {
            background-color: black;
            transform: translateX(-100%);
            left: 100%;
        }

        &:hover {
            background-color: color-mix(in srgb, var(--color), white 12%);

            div {
                background-color: #121212;
            }
        }
    }

    div {
        position: relative;

        width: 18px;
        height: 18px;

        background-color: #484848;
        border-radius: 4px;

        transition: 135ms ease;
        transition-property: width;
    }

    &:focus {
        outline: solid 2px white;
        outline-offset: 2px;
    }
}

.selector button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    border: none;
    border-radius: 6px;
    background-color: #242424;

    font-weight: 700;
    color: var(--color);

    span {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 24px;
        height: 24px;
        border-radius: 3px;

        color: black;
        background-color: var(--color);
    }

    &.a {
        --color: #ff7171;
    }

    &.b {
        --color: #e71825;
    }

    &.active {
        outline: solid 2px white;
        outline-offset: -2px;
    }

    &:hover {
        background-color: #303030;
    }
}

@font-face {
    font-family: Automaton;
    src: url('Automaton.ttf');
}

@font-face {
    font-family: Normal;
    src: url('Normal.ttf');
}
