:root {
    --palette-black: #000000;
    --palette-red: #ff5370;
    --palette-green: #c3e88d;
    --palette-yellow: #ffcb6b;
    --palette-blue: #82aaff;
    --palette-purple: #D49BFD;
    --palette-teal: #89ddff;
    --palette-cyan: #b2ccd6;
    --palette-black-alt: #a0a0a0;
    --palette-red-alt: #9e4057;
    --palette-green-alt: #7d9367;
    --palette-yellow-alt: #ffcb6b;
    --palette-blue-alt: #5970a6;
    --palette-purple-alt: #9e73bd;
    --palette-teal-alt: #76bedb;
    --palette-cyan-alt: #b7d2da;
    --palette-background: #252837;
    --palette-foreground: #a6accd;
    --palette-white: #ffffff;
    --palette-card-bg: #1c1e2b;
    --palette-muted: #676e95;
    --font-heading: "Saira", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

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

html {
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: var(--palette-yellow);
    font-weight: 600;
    transition: color 200ms ease-in-out, border-color 200ms ease-in-out;
}

a:hover {
    color: var(--palette-purple);
}

body {
    background-color: var(--palette-background);
    color: var(--palette-foreground);
    font-family: var(--font-heading);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem 1rem 3rem 1rem;
}

header {
    border-bottom: 1px solid var(--palette-green);
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

header a h1 {
    font-size: 2.25rem;
    color: var(--palette-white);
    font-family: var(--font-heading);
    font-weight: 700;
}

header nav ul {
    list-style-type: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

header nav ul li {
    font-size: 1.25rem;
    font-family: var(--font-mono);
}

header nav ul li a {
    color: var(--palette-foreground);
}

header nav ul li a:hover {
    color: var(--palette-green);
}

main {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.textbox {
    background-color: var(--palette-card-bg);
    border: 1px solid var(--palette-green);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

.textbox:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* Unified Headings (Homepage Sections & Markdown Textbox Headings) */
main > h2,
.section-container > h2,
.textbox h1,
.textbox h2,
.textbox h3 {
    color: var(--palette-white);
    font-size: 1.6rem;
    font-family: var(--font-mono);
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(195, 232, 141, 0.25);
    display: flex;
    align-items: center;
}

main > h2::before,
.section-container > h2::before,
.textbox h1::before,
.textbox h2::before,
.textbox h3::before {
    content: "# ";
    color: var(--palette-green);
    margin-right: 0.25rem;
}

.textbox p {
    margin-bottom: 1.1rem;
    font-size: 1.05rem;
    color: var(--palette-foreground);
    line-height: 1.7;
}

.textbox p:last-child {
    margin-bottom: 0;
}

.textbox strong {
    color: var(--palette-white);
    font-weight: 600;
}

/* In-TOML Text Classes */
.text-green {
    color: var(--palette-green);
}

.text-yellow {
    color: var(--palette-yellow);
}

.text-blue {
    color: var(--palette-blue);
}

.text-purple {
    color: var(--palette-purple);
}

.text-cyan {
    color: var(--palette-cyan);
}

.text-red {
    color: var(--palette-red);
}

.text-muted {
    color: var(--palette-muted);
}

/* Section Containers for Blog Posts and Projects */
.section-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* Posts & Projects Grid Layouts */
.posts-grid,
.posts-list,
.projects-grid,
.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.post-card,
.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Card Title Overrides for Linked Titles */
.post-card h3,
.project-card h3 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--palette-white);
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    display: block;
}

.post-card h3::before,
.project-card h3::before {
    content: none !important;
}

.post-card h3 a,
.project-card h3 a {
    color: var(--palette-yellow);
}

.post-card h3 a:hover,
.project-card h3 a:hover {
    color: var(--palette-purple);
}

.post-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--palette-muted);
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background-color: rgba(130, 170, 255, 0.12);
    color: var(--palette-blue);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(130, 170, 255, 0.25);
}

/* Media Queries */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    header nav ul {
        gap: 1rem;
    }

    header nav ul li {
        font-size: 1.1rem;
    }

    .textbox {
        padding: 1.25rem;
    }
}

