* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.scroller {
    overflow-y: scroll;
    scrollbar-color: #0a4c95 #c2d2e4;
}

:root {
    --bg: #101010;
    --fg: #e4e4ef;
    --border: #333333;
    --hover: #1a1a1a;
    --code-comment: #e09855;
    --code-keyword: #e8b563;
    --code-string: #a3c76f;
    --code-function: #83a5ba;
    --code-number: #9e95c7;
}

[data-theme="light"] {
    --bg: #ffffff;
    --fg: #131313;
    --border: #e0e0e0;
    --hover: #f5f5f5;
    --code-comment: #e09855;
    --code-keyword: #e8b563;
    --code-string: #a3c76f;
    --code-function: #83a5ba;
    --code-number: #9e95c7;
}

body {
    font-family: "Rubik", sans-serif;
    background: var(--bg);
    color: var(--fg);
    transition:
        background 0.3s,
        color 0.3s;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    scrollbar-width: none;
}
.hide-scrollbar {
    overflow: auto;
    -ms-overflow-style: none; /* IE 11 */
    scrollbar-width: none; /* Firefox 64 */
}

code,
pre {
    font-family: "JetBrains Mono", monospace;
    display: block;
}

.code-header {
    font-size: 0.85rem;
    font-weight: 450;
    color: var(--fg);
    background: var(--hover);
    border: 0px solid var(--fg);
    border-bottom: none;
    padding: 0.4rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    color: var(--fg);
    transition: opacity 0.2s;
}

.copy-button:hover {
    opacity: 1;
}

.copy-button svg {
    display: block;
}

.container {
    max-width: 850px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}
.header {
    margin-bottom: 3rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 3px;
}
.logo-image {
    width: 55px;
    height: 55px;
    object-fit: cover;
    margin-bottom: 3px;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.nav-links .nav-btn {
    background: none;
    border: none;
    color: var(--fg);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.3rem 0;
    font-family: "Rubik", sans-serif;
    transition: opacity 0.2s;
    opacity: 0.6;
    text-decoration: none;
}
.nav-links .nav-btn:hover {
    opacity: 1;
}
.nav-links .nav-btn.active {
    opacity: 1;
    border-bottom: 1px solid var(--fg);
}

.theme-toggle {
    background: none;
    border: 0px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover {
    background: var(--hover);
}
.theme-toggle svg {
    width: 16px;
    height: 16px;
    stroke: var(--fg);
    fill: none;
}
.moon-icon {
    display: none;
}
.sun-icon {
    display: block;
}
[data-theme="dark"] .sun-icon {
    display: none;
}
[data-theme="dark"] .moon-icon {
    display: block;
}

main {
    width: 100%;
    flex: 1;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

.hero {
    margin-bottom: 3rem;
}
.hero p {
    font-size: 0.95rem;
    opacity: 1;
}
.section {
    margin-bottom: 3rem;
}
.section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-item {
    border-left: 2px solid var(--border);
    padding-left: 1rem;
    padding-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.project-item:hover {
    border-left-color: var(--fg);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.project-item h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.project-item p {
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-link {
    color: var(--fg);
    text-decoration: none;
    opacity: 0.7;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}
.project-link:hover {
    opacity: 1;
}

/* Tree View Styles */
.blog-tree {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}

.tree-folder {
    cursor: pointer;
    padding: 0.3rem 0;
    user-select: none;
    transition: opacity 0.2s;
    font-weight: 500;
}

.tree-folder::after {
    content: "/";
}

.tree-folder:hover {
    text-decoration: underline;
}

.tree-file {
    padding: 0.2rem 0;
}

.tree-file::before {
    content: "-";
    margin-right: 0.3rem;
}

.tree-file a {
    color: var(--fg);
    text-decoration: none;
    transition: opacity 0.2s;
}

.tree-file a:hover {
    text-decoration: underline;
}

.tree-children {
    margin-left: 1.5rem;
    overflow: hidden;
    transition:
        max-height 0.3s ease-out,
        opacity 0.3s ease-out;
}

.tree-folder.collapsed + .tree-children {
    max-height: 0;
    opacity: 0;
}

.blog-post {
    display: none;
}
.blog-post.active {
    display: block;
}
.back-button {
    display: inline-block;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    padding: 0.3rem 0.1rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
    font-family: "Rubik", sans-serif;
    transition: border-color 0.2s;
    font-size: 0.85rem;
    text-decoration: none;
}
.back-button:hover {
    border-bottom-color: var(--fg);
}

.blog-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
}
.blog-content h2 {
    font-size: 1.4rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}
.blog-content h3 {
    font-size: 1.15rem;
    margin-top: 1.4rem;
    margin-bottom: 0.6rem;
    font-weight: 500;
}
.blog-content p {
    margin-bottom: 0.9rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.blog-content pre {
    background: var(--hover);
    padding: 0.75rem;
    overflow-x: auto;
    margin: 0rem 0;
}

.blog-content code {
    font-size: 0.85rem;
    color: var(--fg);
}

.blog-content p code {
    background: var(--hover);
    padding: 0.15rem 0.35rem;
    font-size: 0.8rem;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 0.9rem;
    padding-left: 1.5rem;
    font-size: 0.95rem;
}
.blog-content li {
    margin-bottom: 0.4rem;
}

.hljs {
    background: var(--hover);
    color: var(--fg);
    padding: 0.5rem;
}
.hljs-comment {
    color: var(--code-comment);
    font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-meta,
.hljs-type {
    color: var(--code-keyword);
}
.hljs-string {
    color: var(--code-string);
}
.hljs-title,
.hljs-name,
.hljs-built_in,
.hljs-variable {
    color: var(--code-function);
}
.hljs-number,
.hljs-attribute {
    color: var(--code-number);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
}

.katex {
    font-size: 25em;
}
.katex-display {
    font-size: 1.1em;
    padding: 0.5rem 0;
    margin: 1.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
}
[data-theme="dark"] .katex {
    color: var(--fg);
}
[data-theme="dark"] .katex .mord,
[data-theme="dark"] .katex .mbin,
[data-theme="dark"] .katex .mrel,
[data-theme="dark"] .katex .mopen,
[data-theme="dark"] .katex .mclose,
[data-theme="dark"] .katex .mpunct {
    color: var(--fg);
}
.blog-content .katex {
    display: inline-block;
    vertical-align: middle;
}
.blog-content .katex-display {
    text-align: center;
}

footer {
    bottom: 0;
    width: 100%;
    background: var(--bg);
    color: var(--fg);
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
    opacity: 0.8;
    margin-top: 75px;
}

.footer a {
    color: inherit;
    padding-top: 0;
}

.footer a:hover {
    text-decoration: underline;
    opacity: 1;
}
