@import url("/css/github-alerts/github-base.css");
@import url("/css/github-alerts/github-colors-light.css");
@import url("/css/github-alerts/github-colors-dark-class.css");

:root {
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
    --font-serif: "IBM Plex Serif", Georgia, serif;
    --font-mono: "IBM Plex Mono", monospace;

    /* Cyberdream dark mode (default) */
    --color-bg: #16181a;
    --color-bg-alt: #1e2124;
    --color-bg-highlight: #3c4048;
    --color-fg: #ffffff;
    --color-grey: #7b8496;

    --color-blue: #5ea1ff;
    --color-green: #5eff6c;
    --color-cyan: #5ef1ff;
    --color-red: #ff6e5e;
    --color-yellow: #f1ff5e;
    --color-magenta: #ff5ef1;
    --color-pink: #ff5ea0;
    --color-orange: #ffbd5e;
    --color-purple: #bd5eff;

    --color-note: var(--color-blue);
    --color-tip: var(--color-green);
    --color-warning: var(--color-red);
    --color-severe: var(--color-pink);
    --color-caution: var(--color-orange);
    --color-important: var(--color-purple);

    --primary: var(--color-magenta);
    --secondary: var(--color-cyan);
    --color-border: var(--color-bg-highlight);

    /* Layout & Component Variables */
    --sidebar-width: 20rem;
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-full: 50%;
    --border-width: 1px;
    --transition: 0.2s ease;
}

[data-theme="light"] {
    /* Cyberdream light mode */
    --color-bg: #ffffff;
    --color-bg-alt: #eaeaea;
    --color-bg-highlight: #acacac;
    --color-fg: #16181a;
    --color-grey: #7b8496;

    --color-blue: #0057d1;
    --color-green: #008b0c;
    --color-cyan: #008c99;
    --color-red: #d11500;
    --color-yellow: #997b00;
    --color-magenta: #d100bf;
    --color-pink: #f40064;
    --color-orange: #d17c00;
    --color-purple: #a018ff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-fg);
    font-family: var(--font-sans);
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    color: var(--primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.6rem;
    border-bottom: var(--border-width) solid var(--color-border);
    padding-bottom: 0.4rem;
}

p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

ul,
ol {
    margin-top: -0.5rem;
}

a {
    color: var(--secondary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}

.layout {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    height: 100vh;
    background-color: var(--color-bg-alt);
    border-right: var(--border-width) solid var(--color-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 3rem 2.5rem;
    max-width: 52rem;
    margin: 0 auto;
    width: 100%;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    border-radius: var(--border-radius-full);
    border: calc(var(--border-width) * 2) solid var(--primary);
    overflow: hidden;
    text-decoration: none;
}

.profile-picture {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin-bottom: 1rem;
    object-position: center -20%;
    transform: scale(1.1);
}

.site-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-fg);
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.site-tagline {
    font-size: 0.85rem;
    color: var(--color-grey);
    margin: 0;
}

.quicklinks {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: flex;
    justify-content: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.quicklinks a {
    color: var(--color-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), transform var(--transition);
    text-decoration: none;
}

.quicklinks a:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.main-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav>li {
    position: relative;
    margin-bottom: 0.5rem;
}

.main-nav a,
.nav-link-main {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--color-fg);
    border-radius: var(--border-radius-sm);
    font-weight: bold;
    transition: background-color var(--transition), color var(--transition);
}

.nav-link-main {
    flex: 1;
    min-width: 0;
}

.nav-children {
    position: absolute;
    top: 0.15rem;
    left: calc(100% + 0.4rem);
    width: 14rem;
    background-color: var(--color-bg-alt);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.22);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-0.25rem);
    transition: max-height var(--transition), opacity var(--transition), transform var(--transition);
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 10;
}

.main-nav>li:hover>.nav-link-main.has-children,
.nav-link-main[aria-current="page"],
.main-nav a:hover,
.main-nav a[aria-current="page"] {
    background-color: var(--color-bg-highlight);
    color: var(--color-fg);
    text-decoration: none;
}

.main-nav>li:hover>.nav-children,
.nav-children:hover {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
}

.nav-children a {
    display: block;
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
    color: var(--color-grey);
    border-radius: 0;
}

.nav-children li:first-child a {
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.nav-children li:last-child a {
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
}

.nav-children a[aria-current="page"] {
    color: var(--color-fg);
}

.nav-link-main.has-children .icon-chevron {
    margin-left: 0.5rem;
    opacity: 0.75;
    font-size: 0.9rem;
    transition: opacity var(--transition);
}

.nav-link-main.has-children:hover .icon-chevron {
    opacity: 1;
}

.content-body code {
    font-family: var(--font-mono);
    background-color: var(--color-bg-alt);
    padding: 0.05em 0.4em;
    border-radius: 0.35rem;
    border: var(--border-width) solid var(--color-grey);
    white-space: pre-wrap;
}

.content-body pre {
    margin: 1.5rem 0;
    overflow: auto;
    border-radius: var(--border-radius-sm);
    background: var(--color-bg-alt);
    border: var(--border-width) solid var(--color-grey);
}

.content-body pre code {
    display: block;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    white-space: pre;
}

.content-body pre code[class*="language-"] {
    background: transparent;
}

mjx-container {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
}

.markdown-alert {
    padding: 1rem;
    margin: 1.5rem 0;
    background-color: var(--color-bg-alt);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

.markdown-alert .markdown-alert-title {
    font-size: inherit;
}

.toc-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 2rem;
    right: 0;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background-color: var(--color-bg-alt);
    border: var(--border-width) solid var(--color-bg-highlight);
    border-radius: var(--border-radius-md);
    padding: 1.25rem 1.5rem;
}

.toc-title {
    font-family: var(--font-sans);
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-purple);
    margin-bottom: 0.75rem;
}

.toc-sidebar .toc {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar .toc ol,
.toc-sidebar .toc ul {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0.25rem 0;
    border-left: var(--border-width) solid var(--color-bg-highlight);
}

.toc-sidebar .toc li {
    margin: 0.6rem 0;
    line-height: 1.4;
}

.toc-sidebar .toc a {
    font-size: 0.95rem;
    color: var(--color-grey);
    text-decoration: none;
    transition: color var(--transition);
}

.toc-sidebar .toc ol a,
.toc-sidebar .toc ul a {
    font-size: 0.9rem;
}

.toc-sidebar .toc a:hover {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.header-anchor {
    opacity: 0;
    margin-left: 0.35em;
    color: var(--color-cyan);
    text-decoration: none;
    transition: opacity var(--transition), color var(--transition);
}

:hover>.header-anchor,
.header-anchor:focus,
.header-anchor:focus-within {
    opacity: 0.6;
}

.header-anchor:hover {
    opacity: 1;
}

main footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: var(--border-width) solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-grey);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: var(--color-grey);
}

.breadcrumbs li:not(:last-child)::after {
    content: ">";
    margin-left: 0.4rem;
    color: var(--color-grey);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: #000;
    padding: 0.5rem 1rem;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

.theme-switch-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.btn-theme {
    background: transparent;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
    border-radius: var(--border-radius-full);
    color: var(--color-grey);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background-color var(--transition);
}

.btn-theme:hover {
    color: var(--color-fg);
    background-color: var(--color-bg-highlight);
}

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon {
    display: inline-block;
}

[data-theme="dark"] .icon-moon,
[data-theme="light"] .icon-sun {
    display: none;
}