/* Flexoki Color System — https://stephango.com/flexoki */

:root {
    --bg: #FFFCF0;
    --bg-2: #F2F0E5;
    --ui: #E6E4D9;
    --ui-2: #DAD8CE;
    --ui-3: #CECDC3;
    --tx: #100F0F;
    --tx-2: #878580;
    --tx-3: #B7B5AC;
    --accent: #205EA6;
    --accent-hover: #4385BE;
    --red: #AF3029;
    --orange: #BC5215;
    --yellow: #AD8301;
    --green: #66800B;
    --cyan: #24837B;
    --blue: #205EA6;
    --purple: #5E409D;
    --magenta: #A02F6F;
}

html.dark {
    --bg: #100F0F;
    --bg-2: #1C1B1A;
    --ui: #282726;
    --ui-2: #343331;
    --ui-3: #403E3C;
    --tx: #FFFCF0;
    --tx-2: #6F6E69;
    --tx-3: #575653;
    --accent: #4385BE;
    --accent-hover: #205EA6;
    --red: #D14D41;
    --orange: #DA702C;
    --yellow: #D0A215;
    --green: #879A39;
    --cyan: #3AA99F;
    --blue: #4385BE;
    --purple: #8B7EC8;
    --magenta: #CE5D97;
}

/* Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

html {
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: et-book, Palatino, "Book Antiqua", Georgia, serif;
    background-color: var(--bg);
    color: var(--tx);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Layout */
.site-wrapper {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.prose {
    max-width: 680px;
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--ui);
    margin-bottom: 3rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tx-2);
    text-decoration: none;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--tx);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dark-toggle {
    background: none;
    border: 1px solid var(--ui-2);
    border-radius: 4px;
    color: var(--tx-2);
    cursor: pointer;
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.5rem;
    transition: border-color 0.15s, color 0.15s;
}

.dark-toggle:hover {
    border-color: var(--tx-2);
    color: var(--tx);
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: et-book, Palatino, "Book Antiqua", Georgia, serif;
    font-weight: normal;
    color: var(--tx);
    line-height: 1.25;
}

h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 0.75rem;
}

h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.5rem;
}

p {
    margin: 0 0 1.25rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

blockquote {
    border-left: 3px solid var(--ui-3);
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.25rem;
    color: var(--tx-2);
    font-style: italic;
}

blockquote p {
    margin: 0;
}

code {
    font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
    font-size: 0.85em;
    background: var(--bg-2);
    border: 1px solid var(--ui);
    border-radius: 3px;
    padding: 0.1em 0.35em;
}

pre {
    background: var(--bg-2);
    border: 1px solid var(--ui);
    border-radius: 6px;
    overflow-x: auto;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    border: none;
    font-size: 0.85rem;
    padding: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--ui);
    margin: 2.5rem 0;
}

ul,
ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

ul li,
ol li {
    margin-bottom: 0.35rem;
}

/* Homepage */
.hero {
    padding: 3rem 0 2rem;
}

.hero-name {
    font-size: 2.25rem;
    margin-bottom: 0.25rem;
}

.hero-title {
    color: var(--tx-2);
    font-family: Inter, system-ui, sans-serif;
    font-size: 1rem;
    margin: 0 0 1.25rem;
}

.hero-bio {
    font-size: 1.05rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.hero-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-links a {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.875rem;
    color: var(--tx-2);
}

.hero-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Section headings */
.section-label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tx-3);
    margin: 0 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ui);
}

/* Post / note list */
.note-list {
    list-style: none;
    margin: 0 0 3rem;
    padding: 0;
}

.note-list-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--ui);
}

.note-list-item:first-child {
    border-top: 1px solid var(--ui);
}

.note-date {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.8rem;
    color: var(--tx-3);
    flex-shrink: 0;
    min-width: 5.5rem;
}

.note-title {
    font-size: 1rem;
    line-height: 1.4;
}

.note-title a {
    color: var(--tx);
}

.note-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Research list */
.research-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.research-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--ui);
    font-size: 0.95rem;
}

.research-list li:first-child {
    border-top: 1px solid var(--ui);
}

.research-list li a {
    color: var(--tx);
}

.research-list li a:hover {
    color: var(--accent);
}

.research-venue {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.8rem;
    color: var(--tx-3);
    margin-left: 0.5rem;
}

/* Individual note page */
.note-header {
    margin-bottom: 2.5rem;
}

.note-header .note-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.note-meta {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.85rem;
    color: var(--tx-2);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.note-body a.invalid-link {
    color: var(--tx-3);
    cursor: default;
}

.note-body a.invalid-link:hover {
    text-decoration: none;
}

.invalid-link-brackets {
    color: var(--tx-3);
}

/* Backlinks */
.backlinks {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ui);
}

.backlinks-label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tx-3);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ui);
}

.backlinks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.backlinks-list a {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.85rem;
    background: var(--bg-2);
    border: 1px solid var(--ui);
    border-radius: 4px;
    color: var(--tx-2);
    padding: 0.2rem 0.6rem;
    transition: border-color 0.15s, color 0.15s;
}

.backlinks-list a:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* Footer */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 2rem 0 3rem;
    margin-top: 3rem;
    border-top: 1px solid var(--ui);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links a {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.85rem;
    color: var(--tx-2);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.8rem;
    color: var(--tx-3);
}

/* Responsive */
@media (max-width: 640px) {
    html {
        font-size: 16px;
    }

    .site-nav {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .note-list-item {
        flex-direction: column;
        gap: 0.2rem;
    }

    .note-date {
        min-width: unset;
    }

    .site-footer {
        flex-direction: column;
    }
}