:root {
    --bg: #82B1FF;
    --fg: #2D1B14;
    --accent: #E91E63;
    --muted: #6b5d58;
    --highlight: #FFC107;
    --natural-green: #2E7D32;
    --card-bg: #F5F5F5;
    --max-width: 50rem;
    --border-radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #2C2A4A;
        --fg: #EAE1DF;
        --accent: #FF007F;
        --muted: #B392AC;
        --card-bg: #1e1c32;
    }
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.7;
    padding: 2rem 1rem;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

header.site-header {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.site-header .logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
}

header.site-header nav a {
    margin-left: 1.5rem;
}


article, .post-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

article header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--muted);
    padding-bottom: 1rem;
}

article header h1 {
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

article header time {
    color: var(--muted);
    font-size: 0.9rem;
}

article h1, article h2, article h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

article p {
    margin-bottom: 1rem;
}

article pre {
    background: var(--bg);
    color: var(--fg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

article code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    background-color: var(--bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

article pre code {
    background: none;
    padding: 0;
}

article blockquote {
    border-left: 4px solid var(--highlight);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--muted);
}

.posts {
    list-style: none;
}

.posts li {
    margin-bottom: 0;
}

.post-card h2 {
    margin-bottom: 0.5rem;
}

.post-card .date {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.post-card p {
    color: var(--muted);
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--muted);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Progress markers for long reads */
.progress-marker {
    display: block;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    margin: 2.5rem 0;
    opacity: 0.6;
}

.progress-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-size: 0.8rem;
}

.progress-nav a {
    color: var(--muted);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.progress-nav a:hover {
    opacity: 1;
}

/* Floating progress indicator */
.progress-indicator {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.progress-indicator.visible {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .progress-indicator {
        right: 0.5rem;
        font-size: 0.7rem;
    }
}

/* Footnote popovers */
.footnote-popover {
    position: absolute;
    background: var(--card-bg);
    color: var(--fg);
    border: 1px solid var(--muted);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow), 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    max-width: min(28rem, calc(100vw - 2rem));
    z-index: 1000;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footnote-popover.visible {
    opacity: 1;
    transform: translateY(0);
}

.footnote-popover-content p {
    margin: 0;
}

.footnote-popover-content p + p {
    margin-top: 0.75rem;
}

.footnote-popover-content a {
    color: var(--accent);
}

/* Make footnote refs more clickable */
.footnote-ref {
    cursor: pointer;
}
