* {
    font-family: "Roboto Condensed", sans-serif;
    box-sizing: border-box;
}

code, code > * {
    font-family: "Roboto Mono", monospace;
    font-size: small;
}

h3 code, h3 code > * {
    font-size: medium;
}

h2 code, h2 code > * {
    font-size: large;
}

h1 code, h1 code > * {
    font-size: x-large;
}

#next-button h3 code, #sidebar code {
    background: hsla(321, 18%, 50%, 0.099);
    display: inline;
    padding: var(--xs) var(--sm);
    border-radius: var(--sm);
}

:root {
    --pink: #ff659b;
    --yellow: #ffc861;
    --sidebar: #eee9ea;
    --back: #f7f2f3;
    --md: 0.5rem;
    --sm: 0.25rem;
    --xs: 0.1rem;
    --accent: #d35176;
    --bold-opacity: 0.5;
    --code-bg: #1d191b;
}

a, .a { color: var(--accent) }

.a {
    text-decoration: underline;
    cursor: pointer;
}

code:not(pre > code) {
    background: var(--sidebar);
    display: inline;
    padding: var(--xs) var(--sm);
    border-radius: var(--sm);
}

body {
    margin: 0;
    background: var(--back);
    display: flex;
    max-height: 100dvh;
    overflow-x: hidden;
    color: #100e0f;
}

#sidebar {
    height: 100dvh;
    width: 300px;
    background: var(--sidebar);
    flex-shrink: 0;
    display: flex;
    justify-content: stretch;
    flex-direction: column;
}

#sidebar-upper {
    background: linear-gradient(70deg, var(--pink), var(--yellow));
    min-height: 15dvh;
    font-size: x-large;
    color: white;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

#logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    cursor: pointer;
}

#logo > span {
    color: transparent;
    text-shadow: 0 0 0 #fff;
}

.index-entry {
    color: inherit;
    text-decoration: none;
}

#chevron {
    display: none;
}

#sidebar-index {
    padding: var(--md);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.section-name {
    opacity: var(--bold-opacity);
    font-size: small;
    font-weight: bold;
    cursor: default;
}

.index-entry {
    padding: var(--md);
    border-radius: var(--md);
    cursor: pointer;
}

.index-entry:hover {
    background: #03000119;
}

.index-entry:active {
    background: #03000129;
}


#chevron-input {
    display: none;
}

#router {
    overflow-y: auto;
    padding: var(--md);
    height: 100dvh;
    flex-grow: 1;
}

pre { 
    background: var(--code-bg); 
    padding: var(--md);
    border-radius: var(--md);
    overflow: auto;
    margin: 0;
}

.dark-code > .token.this { color: #ec71ae; }
.dark-code > .token.function { color: #f3a58e; }
.dark-code > .token.symbolic { color: #fff4f2; }
.dark-code > .token.alphanumeric { color: #f7c7c1; }
.dark-code > .token.ctrlflow { color: #fd9eba; }
.dark-code > .token.declare { color: #f68272; }
.dark-code > .token.number { color: #f6efb3; }
.dark-code > .token.object { color: #f5cf78; }
.dark-code > .token.string { color: #bde48c; }
.dark-code > .token.comment { color: #689f6d; }
.dark-code > .token.blue { color: rgb(129, 191, 223); }
.dark-code > .token.orange { color: hsl(13, 90%, 74%); }
.dark-code > .token.green { color: rgb(178, 235, 147); }

.light-code > .token.this { color: hsl(335, 85%, 60%); }
.light-code > .token.function, .light-code > .token.blue { color: #e16720; }
.light-code > .token.symbolic { color: hsl(343, 6%, 17%) }
.light-code > .token.alphanumeric, .light-code > .token.pink { color: hsl(335, 68%, 46%); }
.light-code > .token.ctrlflow, .light-code > .token.orange { color: hsl(210, 70%, 47%); }
.light-code > .token.declare { color: hsl(0, 70%, 36%); }
.light-code > .token.number { color: hsl(340, 93%, 27%); }
.light-code > .token.object { color: hsl(34, 94%, 40%); }
.light-code > .token.string { color: hsl(82, 63%, 33%); }
.light-code > .token.comment { color: hsl(150, 27%, 31%); }

 /* { color: rgb(252, 190, 173); } */
.light-code > .token.green { color: rgb(88, 148, 55); }

.example {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--md);
}

.resultbox, .resultbox * {
    font-size: large;
}

.resultbox {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar);
    padding: var(--md);
    border-radius: var(--md);
}

button {
    background: var(--pink);
    color: white;
    padding: var(--md);
    border-radius: var(--md);
    cursor: pointer;
    outline: 0;
    border: 0;
    box-shadow: 0 3px 2px #0002;
}

button:active {
    transform: translateY(1px);
}

#next-button > div {
    background: var(--sidebar);
    padding: var(--md);
    text-align: right;
    display: flex;
    gap: var(--md);
    border-radius: var(--md);
    justify-content: right;
    align-items: center;
    cursor: pointer;
    padding-left: calc(6 * var(--md));
}

#next-button {
    display: flex;
    justify-content: right;
}

#next-button p {
    opacity: var(--bold-opacity);
    font-size: small;
    font-weight: bold;
    margin: 0;
}

#next-button h3 {
    margin: 0;
    padding: var(--md) 0;
}

.selected, .selected:hover, .selected:active {
    background: #f3cfdb;
    cursor: default;
}

.rainbow-text {
    background: var(--code-bg);
    display: inline;
    padding: var(--xs) var(--sm);
    border-radius: var(--sm);
}

.props-demo {
    display: flex;
    padding: var(--md);
    gap: var(--md);
    border-radius: var(--md);
}

.props-demo > div {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.memo-demo, .memo-demo > div, .keys-demo-list {
    display: flex;
    flex-direction: column;
    gap: var(--md);
}

.memo-demo .record, input, .keys-demo-list-item {
    background: var(--back);
    padding: var(--md);
    border-radius: var(--md);
    border: 2px solid #ff659b20;
}

.keys-demo-list-item > div {
    display: flex;
    gap: var(--md);
}

.keys-demo-list-item { 
    transition: color 0.2s ease-in-out;
}

input {
    appearance: none;
    outline: 0;
    height: fit-content;
}

@media (max-aspect-ratio: 2/3) or (max-width: 600px) {
    body {
        flex-direction: column;
    }

    .example {
        grid-template-columns: 1fr;
    }

    #sidebar-index {
        height: 0;
        padding: 0;
        overflow-y: hidden;
    }

    #sidebar-upper {
        height: calc(2rem + 2 * var(--md));
        flex-grow: 0;
        min-height: 0;
        align-items: center;
        justify-content: space-between;
        padding: var(--md);
        flex-shrink: 0;
    }

    #logo {
        flex-grow: 0;
    }

    #sidebar {
        height: calc(2rem + 2 * var(--md));
        width: 100dvw;
        position: sticky;
        top: 0;
        transition: height 0.2s, flex-shrink 0.2s;
    }

    #chevron {
        display: flex;
        align-items: center;
        cursor: pointer;
        transition: transform 0.2s ease-in-out;
    }
    
    #sidebar:has(#chevron-input:checked) {
        height: 100dvh;
    }

    #sidebar:has(#chevron-input:checked) + #router {
        flex-shrink: 1;
        padding: 0;
    }

    #router {
        transition: height 0.2s, flex-shrink 0.2s, padding 0.2s;
        height: 100%;
    }

    #chevron-input:checked + #sidebar-upper > #chevron {
        transform: rotate(90deg);
    }

    #chevron-input:checked ~ #sidebar-index {
        height: 100%;
        padding: var(--md);
        overflow-y: auto;
    }

    .memo-demo {
        flex-direction: row;
        align-items: center;
    }
}