@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("/fonts/space_grotesk_variable.woff2") format("woff2-variations");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url("/fonts/ibm_plex_sans_variable.ttf") format("truetype-variations");
}

@font-face {
    font-family: "Zed Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/zed_mono_variable.woff2") format("woff2-variations");
}

:root {
    --navbar-opacity: 0.5;
    --navbar-opacity-hover: 1;
    --transition-time: 0.3s;
}

:root,
:root.dark {
    --body-bg: oklch(0.26 0.006 286);
    --main-bg: oklch(0.26 0.006 286);
    --text-color: oklch(80% 0 0);
    --link-color: oklch(70% 0.15 240);
    --link-hover-color: oklch(80% 0.15 240);
    --border-color: oklch(40% 0 0);
    --post-description-color: oklch(60% 0 0);
    --header-bg: oklch(0.24 0.008 285);
    --input-bg: oklch(25% 0 0);
    --button-bg: oklch(30% 0 0);
    --button-hover-bg: oklch(35% 0 0);
    --bg-tile: url("/tile_1_dark.png");
    --bg-color: oklch(20% 0 0);
}

:root.light {
    --body-bg: oklch(98% 0 0);
    --main-bg: oklch(100% 0 0 / 0.85);
    --text-color: oklch(0% 0 0);
    --link-color: oklch(50% 0.15 240);
    --link-hover-color: oklch(60% 0.15 240);
    --border-color: oklch(80% 0 0);
    --post-description-color: oklch(60% 0 0);
    --header-bg: oklch(98% 0 0);
    --input-bg: oklch(95% 0 0);
    --button-bg: oklch(90% 0 0);
    --button-hover-bg: oklch(85% 0 0);
    --bg-tile: url("/tile_1_light.png");
    --bg-color: oklch(100% 0 0);
}

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

body {
    background-color: var(--body-bg);
    background-repeat: repeat;
    color: var(--text-color);
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    font-family: "IBM Plex Sans", sans-serif;
}

html {
    background-color: var(--bg-color);
    color: var(--text-color);
}

p {
    padding: 1rem 0rem;
}

h1 {
    width: 100%;
    text-align: center;
    font-size: xx-large;
}

#root {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100%;
}

.content-wrapper {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.main-content {
    display: grid;
    grid-template-columns: min-content 1fr;
    max-width: 1200px;
    width: 100%;
}

.sidebar {
    opacity: var(--navbar-opacity);
    transition: opacity var(--transition-time) ease;
    display: grid;
    grid-auto-rows: max-content;
    grid-auto-flow: row;
    padding: 1rem;
    align-content: start;
    text-align: right;
}

.sidebar:hover {
    opacity: var(--navbar-opacity-hover);
}

.main-nav ul {
    list-style: none;
    display: grid;
    gap: 1rem;
}

a {
    text-decoration: none;
    color: var(--link-color);
    transition: color var(--transition-time) ease;
}

a:hover {
    color: var(--link-hover-color);
}

.main-nav a {
    color: inherit;
}

.main-nav hr {
    border: 0;
    border-top: 1px solid var(--border-color);
}

main {
    position: relative;
    z-index: 0;
    /*background-color: var(--main-bg);*/
    backdrop-filter: blur(10px);
    /*border: 1px solid var(--border-color);*/
    padding: 0rem 2rem;
}

main {
    & > h1,
    & > h2 {
        padding-bottom: 2rem;
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Space Grotesk", sans-serif;
}

/* Posts page styling */
.posts-page {
    max-width: 800px;
}

.posts-page header {
    padding-bottom: 2rem;
}

.posts-list {
    display: grid;
    gap: 2rem;
}

.post-preview {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.post-preview:last-child {
    border-bottom: none;
}

.post-preview h2 {
    padding-bottom: 0.5rem;
}

.post-preview h2 a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-time) ease;
}

.post-preview h2 a:hover {
    color: var(--link-hover-color);
}

.post-description {
    color: var(--post-description-color);
    padding: 0;
    line-height: 1.5;
}

/* Plot component styling */
.plot-container {
    display: grid;
    place-items: center;
    padding: 1rem;
    background-color: var(--main-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.plot-canvas {
    border: 1px solid var(--border-color);
    background-color: oklch(100% 0 0);
}

.plot-demo-post {
    max-width: 900px;
}

.plot-demo-post header {
    padding-bottom: 2rem;
}

.plot-section {
    display: grid;
    gap: 1rem;
}

.plot-section h2 {
    padding-bottom: 0.5rem;
}

.site-header {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 0.1rem solid var(--border-color);
    width: 100%;
}

.terminal-input {
    font-family: "Zed Mono", monospace;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.terminal-input::placeholder {
    color: var(--post-description-color);
}

.theme-switcher {
    position: relative;
    display: grid;
}

.theme-button {
    background-color: var(--button-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition-time) ease;
    font-size: 1.2rem;
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
}

.theme-button:hover {
    background-color: var(--button-hover-bg);
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    display: grid;
    gap: 0.25rem;
    min-width: 80px;
    z-index: 9999;
}

.theme-dropdown.hidden {
    display: none;
}

.theme-option {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    text-align: left;
    cursor: pointer;
    border-radius: 2px;
    transition: background-color var(--transition-time) ease;
}

.theme-option:hover {
    background-color: var(--button-hover-bg);
}

.theme-option.active {
    background-color: var(--button-bg);
}

/* Projects page styling */
.projects-list {
    display: grid;
    gap: 3rem;
}

.project_listing {
    border: 1px solid var(--border-color);
    padding: 1rem;
    background-color: var(--main-bg);
}

.project-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1rem;
}

.project-title {
    grid-column: 1;
    grid-row: 1;
}

.project-image {
    grid-column: 2;
    grid-row: 1 / 4;
}

.project-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 0.1rem solid var(--border-color);
}

.project-text {
    grid-column: 1;
    grid-row: 2;
}

.project-links {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    gap: 1rem;
}

.project-text p {
    padding: 0rem 0.5rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        grid-auto-flow: column;
        justify-items: center;
        align-content: center;
        text-align: center;
    }

    .main-nav ul {
        grid-auto-flow: column;
    }

    .plot-canvas {
        max-width: 100%;
        height: auto;
    }

    .site-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }

    .terminal-input {
        width: 100%;
    }

    .theme-switcher {
        justify-self: center;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-title {
        grid-column: 1;
        grid-row: 1;
    }

    .project-image {
        grid-column: 1;
        grid-row: 2;
        max-width: 100%;
    }

    .project-text {
        grid-column: 1;
        grid-row: 3;
    }

    .project-links {
        grid-column: 1;
        grid-row: 4;
        display: flex;
        gap: 1rem;
    }
}
