:root {
    color-scheme: dark;

    --text: white;
    --text-alt: rgb(145, 145, 145);

    --bg: rgb(25, 26, 27);
    --border-color: rgb(52, 54, 58);
}

* {
    box-sizing: border-box;

    font-family: 'Inter', Arial, Helvetica, sans-serif;
    color: white;
}
body {
    background-color: var(--bg);
}
h2 {
    margin: 0;
    margin-bottom: 6px;
}
p {
    margin: 0;
    margin-bottom: 6px;
}
*[data-title] { position: relative; }
*[data-title]::before {
    content: attr(data-title);
    pointer-events: none;

    position: absolute;
    top: 100%;
    left: 50%;
    width: max-content;

    background-color: rgba(24, 24, 24, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 9px 24px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);

    opacity: 0;
    transform: translate(-50%, -8px) scale(0.9);
    transition: opacity 0.15s ease, transform 0.1s cubic-bezier(0.075, 0.82, 0.165, 1);
}
*[data-title]:hover::before,
*[data-title]:focus-visible:before {
    opacity: 1;
    transform: translateX(-50%);
}

svg path { fill: var(--text); }
.flex { display: flex; }
.secondary_text { color: var(--text-alt); }

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
header {
    padding-top: 24px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
header .buttons {
    margin-left: auto;
}
header img, header svg {
    width: 32px; height: 32px;
    margin: 4px;
}
.sidebar nav {
    margin-bottom: 40px;
}

/* Main */
.main_content {
    margin-top: 24px;
}
main {
    width: 100%;
}
.sidebar {
    max-width: 300px;
    width: 300px;
    margin-left: 24px;
}

/* Code */
iframe {
    width: 100%;
    min-height: 100px;
    height: 100px;
    max-height: 800px;
    margin-top: -3px;
    border-radius: 0 0 16px 16px;

    resize: vertical;
}

section {
    margin-bottom: 24px;
}
.codeblock {
    font-size: 11pt;

    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 0 0;
    white-space: nowrap;

    padding: 14px;
    width: 100%;
    height: 48px;
    resize: none;
    /* overflow-y: hidden; */

    position: relative;
}
section { position: relative; }
section::after {
    content: "";
    background-image: url(./copy.png);
    background-size: contain;
    height: 24px; width: 24px;
    box-sizing: border-box;
    pointer-events: none;

    position: absolute;
    top: 11px;
    right: 13px;
    opacity: 0;
    transition: opacity 0.1s ease;
}
section:hover::after { opacity: 1; transition-duration: 0.15s; }
#copied {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translate(-50%, -64px);
    
    background-color: rgba(24, 24, 24, 0.8);
    padding: 9px 24px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);

    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-weight: bold;
    font-size: 13pt;
}
#copied.popin {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media screen and (max-width: 960px) {
    .main_content {
        flex-direction: column;
    }
}
