@font-face {
    font-family: "Roboto Mono";
    src: url("../font/RobotoMono-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

@font-face {
    font-family: "Roboto Mono";
    src: url("../font/RobotoMono-Italic.ttf") format("truetype");
    font-style: italic;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

@font-face {
    font-family: "Roboto Mono";
    src: url("../font/RobotoMono-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    text-rendering: optimizeLegibility;
}

@font-face {
    font-family: "Roboto Mono";
    src: url("../font/RobotoMono-BoldItalic.ttf") format("truetype");
    font-style: italic;
    font-weight: 700;
    text-rendering: optimizeLegibility;
}

:root {
    --global-font-size: 16px;
    --global-font-color: #444;
    --mono-font-stack: "Roboto Mono", Menlo, Monaco, "Lucida Console",
        "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono",
        "Courier New", monospace, serif;
    --font-stack: "Roboto Mono", Menlo, Monaco, "Lucida Console", "Liberation Mono",
        "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace,
        serif;
    --global-line-height: 1.6em;
    --page-width: 60em;
    --display-h1-decoration: 1;
}

html.force-dark {
    --background-color: #222225;
    --font-color: #e8e9ed;
    --invert-font-color: #222225;
    --secondary-color: #a3abba;
    --tertiary-color: #a3abba;
    --primary-color: #62c4ff;
    --error-color: #ff3c74;
    --progress-bar-background: #3f3f44;
    --progress-bar-fill: #62c4ff;
    --code-bg-color: #3f3f44;
}

html.force-light {
    --background-color: #fff;
    --font-color: #151515;
    --invert-font-color: #fff;
    --primary-color: #1a95e0;
    --secondary-color: #727578;
    --error-color: #d20962;
    --progress-bar-background: #727578;
    --progress-bar-fill: #151515;
    --code-bg-color: #e8eff2;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #222225;
        --page-width: 60em;
        --font-color: #e8e9ed;
        --invert-font-color: #222225;
        --secondary-color: #a3abba;
        --tertiary-color: #a3abba;
        --primary-color: #62c4ff;
        --error-color: #ff3c74;
        --progress-bar-background: #3f3f44;
        --progress-bar-fill: #62c4ff;
        --code-bg-color: #3f3f44;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --background-color: #fff;
        --font-color: #151515;
        --invert-font-color: #fff;
        --primary-color: #1a95e0;
        --secondary-color: #727578;
        --error-color: #d20962;
        --progress-bar-background: #727578;
        --progress-bar-fill: #151515;
        --code-bg-color: #e8eff2;
    }
}

@media only screen and (max-width: 850px) {
    :root {
        --global-font-size: 14px;
        --global-font-color: #444;
        --global-line-height: 1.6em;
        --page-width: 70em;
    }
}

body {
    font-family: var(--font-stack);
    font-size: var(--global-font-size);
    background-color: var(--background-color);
    color: var(--font-color);
    margin-bottom: 75px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--font-stack);
    clear: both;
}

h1,
.section-heading,
.post h2 {
    position: relative;
    display: inline-block;
    display: table-cell;
    padding: calc(var(--global-space) * 2) 0;
    margin: 0;
    overflow: hidden;
    font-weight: 600;
}

h1::after,
.section-heading::after,
.post h2::after {
    content: "====================================================================================================";
    position: absolute;
    bottom: 5px;
    left: 0;
    display: var(--display-h1-decoration);
}

h1 + *,
.section-heading + *,
.post h2 + * {
    margin-top: 0;
}

h1,
.section-heading {
    margin-bottom: 150px;
}

.active a {
    text-decoration: underline;
}

strong {
    font-weight: bold;
}

.logo {
    font-weight: normal;
}

.terminal-menu li {
    margin-right: 30px;
}

.terminal-prompt::after {
    -webkit-animation: cursor 1s infinite;
    animation: cursor 1s infinite;
    width: 10px;
}

.terminal-prompt::before {
    content: none;
}

.posts-list {
    position: relative;
    padding-left: 0 !important;
    top: 0;
}

.post {
    margin-bottom: 2rem;
}

.post h1,
.post h2 {
    padding-top: 0;
    margin: 0;
    margin-bottom: 8px;
}

.badge-beta {
    display: inline-block;
    font-size: 0.75rem;
    padding: 1px 6px;
    margin-left: 6px;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    border-radius: 3px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-live {
    display: inline-block;
    font-size: 0.75rem;
    padding: 1px 6px;
    margin-left: 6px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 3px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-meta {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

#theme-toggle {
    cursor: pointer;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
}

.footer {
    clear: both;
    margin-top: 100px;
    padding-top: 15px;
    border-top: 1px solid var(--secondary-color);
    color: var(--global-font-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-links div {
    margin-bottom: 4px;
}

.footer-links div:last-child {
    margin-bottom: 0;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--font-color);
    color: var(--font-color);
    padding: 4px 12px;
    margin-right: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    border-radius: 4px;
    font: inherit;
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--invert-font-color);
    border-color: var(--primary-color);
}

#project-search {
    width: 100%;
    margin-bottom: 1rem;
    padding: 6px 10px;
    background: var(--background-color);
    color: var(--font-color);
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    font: inherit;
    box-sizing: border-box;
}

#filter-buttons {
    margin-bottom: 1.5rem;
}

#no-results {
    display: none;
    color: var(--secondary-color);
}

.min-height-page {
    min-height: 55vh;
}

#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    color: var(--font-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    transition: opacity 0.4s ease;
}

#boot-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#boot-text {
    font-family: var(--mono-font-stack);
    font-size: 1rem;
    white-space: pre-wrap;
    max-width: 700px;
    width: 100%;
    background: transparent;
    border: none;
}

body.booting {
    overflow: hidden;
}

.replay-boot-btn {
    background: transparent;
    border: none;
    color: var(--secondary-color);
    font: inherit;
    font-size: 0.85em;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.replay-boot-btn:hover {
    color: var(--primary-color);
}

.matomo-optout-box {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px dashed var(--secondary-color);
    background-color: var(--code-bg-color);
    border-radius: 4px;
    font-size: 0.9em;
}

.matomo-optout-box input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.matomo-optout-box label {
    cursor: pointer;
}

@media only screen and (max-width: 850px) {
    .terminal-nav {
        align-items: flex-start;
        flex-direction: column;
        display: flex;
    }

    .terminal-menu ul {
        align-items: flex-start;
        display: flex;
        flex-direction: row;
        justify-content: left;
        margin-top: 0;
    }

    .terminal-menu li {
        margin-right: 20px;
    }

    .logo {
        padding: calc(var(--global-space) * 1) 0 calc(var(--global-space) * 1);
    }

    .footer {
        margin-top: 50px;
        padding-top: 10px;
    }
}
