:root {
    --bg: #f7fafc; /* Off-white */
    --fg: #2d3748; /* Dark Gray */
    --accent: #3182ce; /* Bright Blue */
    --accent-hover: #2b6cb0; /* Darker Blue */
    --muted: #718096; /* Muted Gray */
    --border: #e2e8f0; /* Light Gray Border */
    --card-bg: #ffffff; /* White */
    --font-sans: 'Instrument Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --bg: #1a202c; /* Dark Slate Blue */
    --fg: #e2e8f0; /* Light Gray */
    --accent: #63b3ed; /* Brightened for better dark mode contrast */
    --accent-hover: #90cdf4; /* Even Lighter Blue */
    --muted: #a0aec0; /* Lighter Muted Gray */
    --border: #2d3748; /* Dark Gray Border */
    --card-bg: #2d3748; /* Dark Gray */
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1a202c; /* Dark Slate Blue */
        --fg: #e2e8f0; /* Light Gray */
        --accent: #63b3ed; /* Brightened for better dark mode contrast */
        --accent-hover: #90cdf4; /* Even Lighter Blue */
        --muted: #a0aec0; /* Lighter Muted Gray */
        --border: #2d3748; /* Dark Gray Border */
        --card-bg: #2d3748; /* Dark Gray */
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background-color: rgba(247, 250, 252, 0.85); /* Updated Light Mode RGBA */
    backdrop-filter: blur(20px);
    z-index: 1000; /* Verhoogd om boven alle content te blijven */
}

[data-theme="dark"] header {
    background-color: rgba(26, 32, 44, 0.85); /* Updated Dark Mode RGBA */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    transition: all 0.2s ease;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--fg);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: -0.05em;
    margin-right: 1rem;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

#theme-toggle:hover {
    color: var(--fg);
    background-color: var(--card-bg);
}

#theme-toggle .sun { display: none; }
#theme-toggle .moon { display: block; }
[data-theme="dark"] #theme-toggle .sun { display: block; }
[data-theme="dark"] #theme-toggle .moon { display: none; }

/* Hero */
.hero {
    padding: 6rem 0 3rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 0;
    color: var(--fg);
}

/* Section */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.section-title::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--border);
}

/* About Content */
.about-content {
    font-size: 1.5rem;
    color: var(--fg);
    max-width: 800px;
    font-weight: 450;
    line-height: 1.5;
}

/* Blog Layout Improvements */
.blog-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    align-items: start;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Uniform Article Grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.featured-grid article {
    grid-column: span 1;
}

@media (max-width: 850px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.article-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.4); /* Much more visible in light mode */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5); /* Stronger white border for "edge" look */
    border-radius: 2rem;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 32px 0 rgba(49, 130, 206, 0.08); /* Faint blue shadow */
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .article-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: 0.5s;
}

.article-card:hover::before {
    left: 100%;
}

.article-card:hover {
    transform: translateY(-12px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.article-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.article-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    max-width: 100%;
}

.article-card h3 a {
    color: var(--fg);
    text-decoration: none;
    transition: color 0.2s;
}

.article-card p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 750px;
}

.read-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
    font-size: 1rem;
    margin-top: 0.5rem;
    transition: gap 0.2s;
}

.read-link:hover {
    gap: 0.75rem;
}

/* Filters Styling */
.blog-filters {
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0;
    margin: 0;
}

.filter-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: block;
}

.filter-btn:hover {
    color: var(--fg);
    transform: translateX(4px);
}

.filter-btn.active {
    color: var(--accent);
    font-weight: 800;
}

.filter-btn.active::before {
    content: '→';
    margin-right: 0.5rem;
    color: var(--accent);
}

/* Individual Post Styling */
.post-header {
    text-align: left;
    padding: 0;
    border: none;
    margin: 0;
    position: relative !important;
    z-index: 1; /* Was -1, wat problemen kan geven met links/selectie */
}

.post-meta-header {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.post-body h1:first-child { 
    font-size: clamp(2.5rem, 8vw, 4rem); 
    font-weight: 800; 
    line-height: 1.1; 
    letter-spacing: -0.05em; 
    margin-top: 0;
    margin-bottom: 3rem;
    color: var(--fg);
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 0 6rem;
}

.post-content h2, .post-content h3 { 
    margin-top: 3rem; 
    margin-bottom: 1.25rem; 
    font-weight: 800; 
    letter-spacing: -0.02em; 
}

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

.post-content blockquote { 
    border-left: 4px solid var(--accent); 
    padding: 1.5rem; 
    margin: 2.5rem 0; 
    background: var(--card-bg); 
    font-style: italic; 
}

.post-content img { 
    width: 100%; 
    height: auto; 
    border-radius: 8px; 
    margin: 2.5rem 0; 
}

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

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

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

.post-footer {
    margin-top: 6rem; 
    padding-top: 2rem; 
    border-top: 1px solid var(--border);
}

.blog-hero, .about-hero {
    padding: 6rem 0 4rem;
}

.blog-hero h1, .about-hero h1 {
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.06em;
    margin-bottom: 2rem;
    color: var(--fg);
}

.about-intro {
    max-width: 800px; 
    margin-bottom: 6rem;
}

.mission-section {
    padding: 4rem 0; 
    border-top: 1px solid var(--border);
}

.mission-content {
    font-size: 1.25rem; 
    line-height: 1.6; 
    color: var(--muted); 
    max-width: 700px;
}

/* Over-pagina Verfijnde Stijlen */
.about-container {
    max-width: 800px; /* Iets breder voor betere tekstbalans */
    margin: 0 auto;
    padding: 8rem 2rem;
}

.about-header {
    margin-bottom: 5rem;
    text-align: left; /* Terug naar links voor rustigere uitlijning */
}

.about-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(49, 130, 206, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.about-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--fg);
    max-width: 600px;
    margin-bottom: 2rem;
}

.about-content-inner {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 650px; /* Tekstbreedte beperken voor leesbaarheid */
}

.about-p {
    font-size: 1.5rem;
    line-height: 1.5;
    color: var(--fg); /* Iets donkerder voor meer 'scherpte' */
    font-weight: 450;
    text-align: left; /* Consistent links uitgelijnd */
}

.about-p strong {
    color: var(--fg);
    font-weight: 600;
}

/* Controls Layout */
.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1rem;
}

@media (max-width: 850px) {
    .controls-container {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Tag Filter Styling */
.tag-filter-container {
    overflow: hidden;
    flex: 1;
}

.tag-filter-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.tag-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem; /* Rectangular with slight rounding */
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.tag-btn.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

/* Search Styling */
.search-container {
    position: relative;
    width: 250px;
}

@media (max-width: 850px) {
    .search-container {
        width: 100%;
    }
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

#article-search {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: var(--fg);
    font-family: inherit;
    transition: all 0.2s;
}

#article-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* Reading Time & Meta */
.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-dot {
    color: var(--border);
}

.reading-time {
    color: var(--muted);
    font-weight: 500;
}

/* Reading Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 2000; /* Boven navigatie (1000) */
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.1s ease-out;
}

@media (max-width: 768px) {
    .post-header {
        padding: 4rem 0;
        margin-bottom: 2rem;
    }
    .post-header h1 {
        font-size: 2.5rem;
    }
}

/* Footer */
footer {
    padding: 8rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 1rem;
    text-align: left;
}

@media (max-width: 850px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    .blog-filters {
        position: relative;
        top: 0;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 2rem;
        border-bottom: 1px solid var(--border);
        margin-bottom: 3rem;
    }
    .filter-btn.active::before { content: none; }
}

@media (max-width: 640px) {
    header { padding: 0.75rem 0; }
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 2.75rem; }
    .article-card h3 { font-size: 1.75rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.875rem; }
    .logo { margin-right: 0.5rem; font-size: 1.125rem; }
    #theme-toggle { padding: 0.4rem; }
    #theme-toggle svg { width: 18px; height: 18px; }
}

/* Animations */
.blog-post-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-post-item.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
}
