html {
    scroll-behavior: smooth;
}

/* ide */

body.ide {
    background-color: rgb(46, 45, 45);
    color: white;
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-style: normal;
}

body.ide.light {
    background-color: rgb(209, 210, 210);
    color: black;
}

body.ide #navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid black;
    color: white;
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-style: normal;
}

body.ide.light #navbar {
    border-bottom: 1px solid white;
    color: black;
}

body.ide #navbar h1 {
    padding-left: 30px;
}

body.ide #navbar nav {
    display: flex;
    gap: 20px;
    padding-right: 10px;
}

body.ide #navbar a {
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: white;
}

body.ide.light #navbar a {
    color: black;
}

body.ide #navbar a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    border-radius: 4px;
    background-color: white;
    bottom: 0;
    left: 0;
    transform-origin: right;
    transform: scaleX(0);
    transition: transform .3s ease-in-out;
}

body.ide.light #navbar a::before {
    background-color: black;
}

body.ide #navbar a:hover::before {
    transform-origin: left;
    transform: scaleX(1);
}

body.ide #holder {
    display: flex;
}

body.ide .half {
    padding-left: 5px;
    width: 50%;
    min-height: 98dvh;
}

body.ide #code {
    border-right: 1px solid black;
}

body.ide.light #code {
    border-right: 1px solid white;
}

body.ide #code textarea {
    margin-left: 25px;
    padding: 5px;
    resize: none;
    width: 95%;
    height: 87%;
    box-sizing: border-box;
    border: none;
    background-color: rgb(46, 45, 45);
    color: white;
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-style: normal;
}

body.ide.light #code textarea {
    background-color: rgb(209, 210, 210);
    color: black;
}

body.ide #right {
    display: flex;
    flex-direction: column;
}

body.ide .quarter {
    width: 100%;
    height: 50%;
}

body.ide .title {
    padding-left: 25px;
}

body.ide #input textarea {
    padding: 5px;
    margin-left: 25px;
    width: 80%;
    height: 70%;
    box-sizing: border-box;
    border: none;
    background-color: rgb(46, 45, 45);
    color: white;
    resize: none;
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-style: normal;
}

body.ide.light #input textarea {
    background-color: rgb(209, 210, 210);
    color: black;
}

body.ide #output {
    border-top: 1px solid black;
}

body.ide.light #output {
    border-top: 1px solid white;
}

body.ide #button-holder {
    display: flex;
}

body.ide #output button {
    margin-left: 25px;
    margin-top: 25px;
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-style: normal;
    border: 1px solid white;
    background-color: rgb(46, 45, 45);
    color: white;
}

body.ide.light #output button {
    border: 1px solid black;
    background-color: rgb(209, 210, 210);
    color: black;
}

body.ide #output pre {
    padding-left: 30px;
}

/* documentation */

body.doc {
    background-color: rgb(46, 45, 45);
    color: white;
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-style: normal;
    display: flex;
    margin: 0;
}

body.doc.light {
    background-color: rgb(209, 210, 210);
    color: black;
}

body.doc .content {
    max-width: 900px;
    line-height: 1.6;
    animation: fadeIn .4s ease;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(10px);}
    to {opacity: 1; transform: translateY(0);}
}


body.doc #navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid black;
    color: white;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: inherit;
    padding: 10px 0;
    z-index: 10;
}

body.doc.light #navbar {
    border-bottom: 1px solid white;
    color: black;
}

body.doc #navbar h1 {
    padding-left: 30px;
}

body.doc #navbar nav {
    display: flex;
    gap: 20px;
    padding-right: 10px;
}

body.doc #navbar a {
    text-decoration: none;
    position: relative;
    cursor: pointer;
    color: white;
}

body.doc.light #navbar a {
    color: black;
}

body.doc #navbar a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    border-radius: 4px;
    background-color: white;
    bottom: 0;
    left: 0;
    transform-origin: right;
    transform: scaleX(0);
    transition: transform .3s ease-in-out;
}

body.doc.light #navbar a::before {
    background-color: black;
}

body.doc #navbar a:hover::before {
    transform-origin: left;
    transform: scaleX(1);
}

body.doc .sidebar {
    position: sticky;
    top: 100px;
    height: calc(100vh - 160px);
    width: 220px;
    padding: 20px;
    box-sizing: border-box;
    border-right: 1px solid black;
}

body.doc.light .sidebar {
    border-right: 1px solid white;
}

body.doc .sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

body.doc .sidebar a {
    text-decoration: none;
    color: white;
    font-size: 14px;
    position: relative;
    transition: opacity .2s, transform .2s;
}

body.doc.light .sidebar a {
    color: black;
}

body.doc .sidebar a:hover {
    opacity: 0.8;
    transform: translateX(3px);
}

body.doc .content {
    padding: 100px 40px 40px 40px;
    box-sizing: border-box;
}

body.doc.light .content {
    color: black;
}

body.doc .title {
    scroll-margin-top: 125px;
}

body.doc img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid black;
    max-width: 75%; 
    height: auto;
}

body.doc.light img {
    border: 1px solid white;
}

body.doc .subtitle {
    text-align: center;
    font-size: 12px;
}

body.doc .content a {
    color: white;
}

body.doc.light .content a {
    color: black;
}

body.doc .content a {
    position: relative;
    color: inherit;
    text-decoration: none;
}

body.doc .content a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 0%;
    height: 1px;
    background: currentColor;
    transition: width .25s ease;
}

body.doc .content a:hover::after {
    width: 100%;
}

code {
    background-color: rgb(35, 35, 35);
    padding: 12px;
    border-radius: 6px;
}

body.doc.light code {
    background-color: rgb(230, 230, 230)
}

pre code {
    background-color: rgb(35, 35, 35);
    padding: 12px;
    border-radius: 6px;
    display: block;
}

body.doc.light pre code {
    background-color: rgb(230, 230, 230);
}

#backtop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgb(60,60,60);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    border: 1px solid black;
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-style: normal;
}

body.doc.light #backtop {
    background: rgb(200, 200, 200);
    color: black;
    border: 1px solid white;
}

#backtop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

body.doc::-webkit-scrollbar {
    width: 10px;
}

body.doc::-webkit-scrollbar-thumb {
    background: rgb(80,80,80);
    border-radius: 5px;
}

body.doc.light::-webkit-scrollbar-thumb {
    background: rgb(180,180,180);
}


