:root {
    --bg: #fafaf9;
    --fg: #1c1917;
    --accent: #b45309;
    --muted: #78716c;
    --border: #e7e5e4;
    --code-bg: #f5f5f4;
}

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

body {
    font-family: 'Lora', Georgia, serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.8;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

.site-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-title:hover {
    color: var(--accent);
}

nav {
    margin-top: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

nav a {
    color: var(--fg);
    text-decoration: none;
    margin: 0 1rem;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

nav a:hover {
    border-bottom-color: var(--accent);
}

/* Divider */
.divider {
    width: 40px;
    height: 1px;
    background: var(--border);
    margin: 2rem auto;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.tagline {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--muted);
}

/* Section titles */
.section-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Posts list */
.posts article {
    margin-bottom: 2.5rem;
}

.posts h2,
.posts h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.posts h2 a,
.posts h3 a {
    color: var(--fg);
    text-decoration: none;
}

.posts h2 a:hover,
.posts h3 a:hover {
    color: var(--accent);
}

.post-meta {
    font-family: 'Inter', sans-serif;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.post-excerpt {
    color: var(--muted);
    font-size: 0.95rem;
}

.view-all {
    margin-top: 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

.view-all a {
    color: var(--accent);
    text-decoration: none;
}

.view-all a:hover {
    text-decoration: underline;
}

/* Single post */
.post-full .post-header {
    margin-bottom: 2rem;
}

.post-full h1 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.post-content {
    margin-bottom: 3rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content h1 {
    font-size: 1.5rem;
}

.post-content h2 {
    font-size: 1.25rem;
}

.post-content h3 {
    font-size: 1.1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

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

.post-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.post-content pre {
    background: #2b303b;
    color: #c0c5ce;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

.post-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

.post-footer a {
    color: var(--accent);
    text-decoration: none;
}

.post-footer a:hover {
    text-decoration: underline;
}

/* About page */
.about p {
    margin-bottom: 1.5rem;
}

.about a {
    color: var(--accent);
}

/* Samples page */
.samples .intro {
    margin-bottom: 2rem;
}

/* Search and Filter Section */
.search-filter {
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--fg);
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-box input::placeholder {
    color: var(--muted);
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Tags */
.tags-section {
    margin-bottom: 1rem;
}

.tags-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    background: var(--code-bg);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tag.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.tag-count {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* Active Filters */
.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.active-filters-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--muted);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--accent);
    color: white;
    border-radius: 4px;
}

.filter-chip button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
}

.filter-chip button:hover {
    opacity: 1;
}

.clear-all {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
    margin-left: auto;
}

.clear-all:hover {
    color: var(--accent);
}

/* Results count */
.results-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* Post tags in list and detail */
.post-tags {
    display: inline-flex;
    gap: 0.35rem;
    margin-left: 0.5rem;
}

.post-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    background: var(--code-bg);
    color: var(--muted);
    border-radius: 100px;
    text-decoration: none;
}

.post-tag:hover {
    color: var(--accent);
}

/* Search highlight */
mark {
    background: #fef3c7;
    color: var(--fg);
    padding: 0 0.1rem;
    border-radius: 2px;
}

/* Empty states */
.empty-state {
    color: var(--muted);
    font-style: italic;
    text-align: center;
    padding: 3rem 1rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 1rem;
}

.error-page .error-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.error-page .error-message {
    color: var(--muted);
    margin-bottom: 2rem;
}

.error-page a {
    color: var(--accent);
    text-decoration: none;
}

.error-page a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    font-family: 'Inter', sans-serif;
    color: var(--muted);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 800px) {
    .container {
        padding: 2rem 1rem;
    }

    .site-title {
        font-size: 1.5rem;
    }

    nav a {
        margin: 0 0.5rem;
    }

    .post-full h1 {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* Tags wrap nicely on mobile */
    .tags {
        gap: 0.4rem;
    }

    .tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    /* Active filters stack on mobile */
    .active-filters {
        flex-wrap: wrap;
    }

    /* Post meta stacks on mobile */
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .post-tags {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    nav a {
        margin: 0;
    }

    .search-box input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .posts h2,
    .posts h3 {
        font-size: 1.1rem;
    }

    .post-excerpt {
        font-size: 0.9rem;
    }
}
