
@import "lib/katex/katex.min.css";
@import "lib/bootstrap-icons/font/bootstrap-icons.min.css";

:root {
    --text-color: #cccccc;
    --background-color: #151515;
    --background-color-darker: #0c0c0c;
    --demo-theme-color: #50cdb1;
    --demo-theme-secondary-color: rgba(58, 107, 82, 0.25);
}

body {
    margin: 0;
    background: var(--background-color);
    color: var(--text-color);
    font-family: Consolas, monospace;
    font-size: 1rem;
}

a {
    color: var(--demo-theme-color);
    text-decoration: none;
}
a:hover {
    filter: brightness(0.7);
    text-decoration: underline;
}

.largeList {
    font-size: 1.3em;
    display: inline-flex;
    flex-flow: column;
    gap: 0.5em;
    text-align: initial;
    margin: 1em 0px;
}

span-latex {
    text-wrap: nowrap;
}

.eq {
    text-align: center;
}
.eq > span-latex {
    display: inline-block;
    text-align: left;
}

#pageContainer {
    padding-bottom: 40px;
    position: relative;
    min-height: calc(100vh - 40px);
}

#banner {
    height: 80px;
    display: flex;
    align-items: center;
    background-color: var(--background-color-darker);
    font-size: 1.2rem;
    user-select: none;
}
#banner > * {
    width: calc(100% / 3);
}
#banner > *:nth-child(1) {
    height: 100%;
}
#banner > *:nth-child(2) {
    height: calc(100% - 2*20px);
    padding: 20px;
    text-align: center;
    font-size: 1.4em;
}
#banner > *:nth-child(3) {
    height: calc(100% - 2*20px);
    padding: 20px;
    text-align: right;
}
#banner * {
    vertical-align: middle;
}
#banner a {
    color: inherit;
    text-decoration: inherit;
}
#banner .button {
    display: inline-flex;
    height: 100%;
    aspect-ratio: 1;
    font-size: 2em;
    cursor: pointer;
}
#banner .button > * {
    margin: auto;
}
#banner .button:hover {
    color: var(--demo-theme-color);
    background-color: var(--background-color);
}

#footer {
    position: absolute;
    bottom: 0;
    height: 20px;
    padding: 10px 20px;
    font-size: 0.9em;
}
#footer > *:nth-child(1) {
    float: left;
}
#footer > *:nth-child(2) {
    float: right;
}

#sidebarOverlay {
    display: none;
    position: fixed;
    z-index: 10;
    width: 100vw;
    height: calc(100% - 80px);
}
#sidebarOverlay.active {
    display: initial;
}
#sidebar {
    width: 100%;
    max-width: 20rem;
    height: 100%;
    font-size: 1.2rem;
    color: var(--text-color);
    background-color: var(--background-color-darker);
    user-select: none;
}
#sidebar > a {
    display: block;
    padding: 1em 2em;
    color: inherit;
    filter: none;
    cursor: pointer;
}
#sidebar > a:hover {
    text-decoration: none;
    color: var(--demo-theme-color);

    padding: calc(1em - 1px) 2em;
    border-style: solid;
    border-width: 1px 0;
    border-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        var(--demo-theme-color) 50%,
        rgba(0, 0, 0, 0) 100%
    ) 1;
}

.textbox {
    max-width: 1000px;
    margin: auto;
    font-size: 1.1em;
    padding: 20px;
    color: var(--text-color);
}
.textbox.center {
    text-align: center;
}
.textbox .bi {
    color: white;
}

.indexList {
    width: 70%;
    margin: auto;
    font-size: 1.3em;
    text-align: initial;
}

.indexList > li {
    margin: 1.3em 0;
}

.demosGrid {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.demosGridCell {
    position: relative;
    width: 300px;
    height: 300px;
    border: 1px solid black;
    user-select: none;
    cursor: pointer;
}
.demosGridCell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@keyframes gridCellHover {
    from { filter: none; }
    to { filter: blur(3px) brightness(0.5); }
}
.demosGridCell img:hover {
    filter: blur(3px) brightness(0.5);
    animation: gridCellHover 0.15s ease-out;
}
.demosGridCell .overlay {
    display: none;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 2*20px);
    height: calc(100% - 2*20px);
    padding: 20px;
    text-align: center;
    font-size: 1.5rem;
    pointer-events: none;
}
.demosGridCell:hover .overlay {
    display: flex;
}

.blogLinks {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.blogLinks > * {
    padding: 5px;
    overflow: hidden;
}
.blogLinks a {
    display: block;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}





.demoText {
    width: 90vw;
    max-width: 1000px;
    margin: auto;
    font-size: 1.1em;
    line-height: 1.4em;
    text-align: justify;
    color: var(--text-color);
    margin-bottom: 50px;
}

.demoText h1 {
    text-align: center;
}
.demoText h1 {
    margin-top: 1em;
}
.demoText h2, .demoText h3 {
    margin-top: 2em;
}
.demoText > img,
.demoText .imgText,
.demoText pre {
    display: block;
    max-width: 90%;
    margin: 2rem auto;
}
.demoText .imgText {
    font-size: 0.8em;
    text-align: initial;
    margin-top: -1.5rem;
}
.demoText code,
.demoText pre {
    background-color: #292929;
    padding: 0 0.3em 0.1em 0.3em;
    border-radius: 5px;
}
.demoText pre {
    font-size: 0.9em;
    padding: 0.7em;
    overflow-x: auto;
}
.demoText ul, .demoText ol {
    text-align: initial;
}

#demoContainer {
    position: relative;
    width: min(90vw, calc(95vh - 100px), 1000px);
    height: min(90vw, calc(95vh - 100px), 1000px);
    margin: auto;
    touch-action: none;
}
#demoContainer.compact {
    width: min(90vw, calc(95vh - 100px), 700px);
    height: min(90vw, calc(95vh - 100px), 700px);
}
#demoContainer.maximised {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
}

.demoLinkBar {
    display: flex;
    box-sizing: border-box;
    width: min(90vw, calc(95vh - 100px), 1000px);
    margin: auto;
    padding: 10px;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}
.demoLinkBar.compact {
    width: min(90vw, calc(95vh - 100px), 700px);
}
.demoLinkBar a {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}
.demoLinkBar img {
    height: 1em;
}
.demoLinkBar .bi {
    color: white;
}

#settingsContainer {
    position: absolute;
    top: 20px;
    right: 0px;
    min-width: calc(1.5rem + 10px);
    min-height: calc(1.5rem + 10px);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--demo-theme-color);
    user-select: none;
}

#settingsContainer .expandButton {
    position: absolute;
    top: 0;
    right: 0;
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
    padding: 5px;
    transform: scaleX(-1);
    cursor: pointer;
}

#settingsContainer .expandButton:hover {
    color: black;
    background-color: var(--demo-theme-color);
}

.demoSetting {
    display: flex;
    padding: 3px;
    gap: 10px;
    font-family: monospace;
    font-size: 1.1em;
    width: 400px;
    max-width: calc(90vw - 5px);
}

.demoSetting > div:first-child {
    flex: 55;
    text-align: right;
}
.demoSetting > div:nth-child(2) {
    flex: 45;
}

.demoSetting input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: calc(100% - 3px);
    background-color: var(--demo-theme-secondary-color);
}
.demoSetting input[type=range]::after {
    content: attr(data-value);
    color: var(--demo-theme-color);
    position: relative;
    top: 3px;
    right: 3px;
    margin-left: 5px;
}
.demoSetting input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--demo-theme-color);
    cursor: pointer;
}
.demoSetting input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--demo-theme-color);
    cursor: pointer;
}

.demoSetting input[type=checkbox] {
    accent-color: var(--demo-theme-color);
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.demoSetting input[type=checkbox]:not(:checked) {
    appearance: none;
   -webkit-appearance: none;
   -moz-appearance: none;
}
.demoSetting input[type=checkbox]:not(:checked)::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    background-color: var(--demo-theme-color);
    opacity: 0.3;
    border-radius: 2px;
}

.demoSetting select {
    width: calc(100% - 3px);
    height: 20px;
    margin: 2px;
    padding-right: 5px;
    color: var(--demo-theme-color);
    background-color: var(--demo-theme-secondary-color);
    border: none;
}
.demoSetting select option {
    height: 20px;
    background-color: black;
}

.demoSetting button {
    margin: 3px;
    font-size: 1em;
    color: var(--demo-theme-color);
    background-color: rgba(0, 0, 0, 0);
    border: 1px solid var(--demo-theme-color);
    cursor: pointer;
}
.demoSetting button:hover {
    color: black;
    background-color: var(--demo-theme-color);
}

.demoSetting input[type=color] {
    background-color: var(--demo-theme-secondary-color);
    border: none;
    cursor: pointer;
}

.demoSetting .buttonContainer {
    display: flex;
    gap: 5px;
}
.demoSetting .buttonContainer > button {
    height: 22px;
    flex: 1;
}





@media (max-width: 600px) {
    body {
        font-size: 0.8rem;
    }
    #banner {
        font-size: 0.9rem;
    }
}
