/* CSS Custom Properties */
:root {
    --accent: #75B6FF;
    --text-primary: #fdfdfd;
    --text-secondary: rgba(245, 245, 245, 0.9);
    --alt-text: #555555;
    --bg: black;
    --spacing: 1rem;
}

/* Font Declarations */
@font-face {
    font-family: 'Lexend';
    src: url('/static/fonts/Lexend/Lexend-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('/static/fonts/Open_Sans/OpenSans-VariableFont_wdth,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/static/fonts/JetBrains_Mono/JetBrainsMono-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 100 900;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-size: 18px;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 1em;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text-primary);
    padding: 50px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 900px;
    margin: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lexend', sans-serif;
    margin-bottom: var(--spacing);
}

h1 {
    font-weight: 700;
    font-size: 2em;
}

h2 {
    font-weight: 600;
    font-size: 1.7em;
}

h3, h4, h5, h6 {
    font-weight: 400;
}

/* Links */
a {
    color: var(--accent);
    cursor: pointer;
}

strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15em;
    color: var(--accent);
    margin-right: calc(var(--spacing) * .5);
}

a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Layout Components */
header {
    display: flex;
    align-items: center;
    margin-bottom: calc(var(--spacing) * 4);
}

header img {
    height: 90px;
}

main {
    flex-grow: 1;
}

section {
    margin-bottom: calc(var(--spacing) * 4);
}

footer {
    margin-top: auto;
    padding-top: calc(var(--spacing) * 4);
    text-align: right;
    color: var(--text-primary);
    font-size: .8em;
}

/* Lists - Consolidated */
ul {
    list-style: none;
}

ol {

}

ol li {
    font-size: .9em;
    padding-left: var(--spacing);
    margin-left: var(--spacing);
    margin-bottom: calc(var(--spacing) * .5);
}

.quick-jump {
    font-size: .8em;
    text-align: right;
}

table {
    font-size: .8em;
    border-collapse: collapse;
    width: 100%;
    color: var(--text-secondary);
    margin-top: calc(var(--spacing) * 2);
}
th, td {
    padding: 8px;
    text-align: center;
    border: 1px solid var(--alt-text);
}
th {
}
.table-container {
    overflow-x: auto;
    margin-bottom: calc(var(--spacing) * 4);
}
.table-container h3 {
    color: var(--accent);
}
.metric-name {
    text-align: left;
}

.section-header {
    font-weight: bold;
}

/* New Grid Layout */
.projects-list,
.research-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: calc(var(--spacing) * 3) calc(var(--spacing) * 3);
    align-items: start;
}

.updates {
    /* Keep as single column */
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing) * 1.5);
}

.projects-list li,
.research-list li,
.updates li {
    font-size: .9em;
    margin-bottom: 0;
}


/* Monospace Links and Strong Elements */
.projects-list strong,
.research-list strong,
.updates strong,
.projects-list a,
.research-list a,
.updates a {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 1.15em;
    color: var(--accent);
    margin-right: calc(var(--spacing) * .5);
}

.projects-list strong,
.research-list strong,
.updates strong {
    cursor: default;
}

.projects-list a,
.research-list a,
.updates a {
    cursor: pointer;
}

/* Case Study Styles */
.project-title {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

.project-meta {
    display: flex;
    gap: calc(var(--spacing) * 1.5);
    flex-wrap: wrap;
    margin-top: calc(var(--spacing) * 1.5);
    font-size: .85em;
    color: var(--text-secondary);
    opacity: 0.85;
}

.section-content {
    margin-top: var(--spacing);
}

.section-content p {
    margin-bottom: calc(var(--spacing) * 2);
}

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

#case-study-nav {
    margin-top: calc(var(--spacing) * 3);
    padding-top: calc(var(--spacing) * 2);
}

.return-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: .9em;
    color: var(--accent);
    transition: opacity 0.2s ease;
}

.return-link:hover {
    opacity: 0.7;
}

/* Code Formatting */
.code_container {
    border: 1px solid var(--alt-text);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: calc(var(--spacing) * 2) 0;
}

pre {
    margin: 0;
    padding: calc(var(--spacing) * 1.5);
    overflow-x: auto;
    background: transparent;
}

f-code,
.code_container code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    color: var(--text-primary);
    white-space: pre;
    display: block;
}

/* Button Container and Pills */
.button-container {
    display: flex;
    gap: 0;
    margin-top: 0;
    margin-bottom: calc(var(--spacing) * 1.5);
    justify-content: flex-start;
}

.pill-button {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    font-weight: 500;
    padding: calc(var(--spacing) * 0.5) calc(var(--spacing) * 1);
    border: 1px solid var(--alt-text);
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.pill-button:first-child {
    border-bottom-left-radius: 8px;
}

.pill-button:last-child {
    border-bottom-right-radius: 8px;
}

.pill-button:hover,
.pill-button.active {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
}

.pill-button.active {
    background: var(--bg);
}

.pill-button.active:hover {
    opacity: 0.9;
}

/* Scrollbar Styling */
.code_container pre::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
    height: 8px;
}

.code_container pre::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
    background: rgba(245, 245, 245, 0.1);
}

.code_container pre::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: var(--alt-text);
}

.code_container pre::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}


/* Responsive Design */
@media screen and (max-width: 768px) {
    body {
        padding: 25px;
    }

    .projects-list,
    .research-list {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing) * 1.5);
    }

    /* Reset the spanning rule on mobile */
    .research-list li:last-child:nth-child(odd),
    .projects-list li:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .project-meta {
        flex-direction: column;
        gap: calc(var(--spacing) * 0.5);
    }
}

