:root {
  --bg-dark: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --accent-blue: #2563eb;
  --accent-teal: #0d9488;
  --accent-amber: #d97706;
  --accent-indigo: #7c3aed;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  
  --term-bg: #0f172a;
  --term-text: #38bdf8;
  
  --radius: 12px;
  --spacing-section: clamp(2.5rem, 5vw, 4rem);
  --max-width: 1200px;
}

/* Custom Scrollbar voor een strakkere desktop look */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-main); }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

/* Header & Nav */
.site-header {
  padding: 1rem var(--spacing-section);
  /* Verhoogde dekking en sterkere blur voor een rustiger 'frosted glass' effect */
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8); /* Flinterdunne lijn voor afbakening */
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
}
.site-header .container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.title-group h1 { font-size: 1.25rem; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.name-last { color: var(--accent-blue); }
.tagline { margin: 0; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }

.nav-links { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 0; align-items: center; }
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-weight: 600;
  font-size: 0.9rem; padding: 0.5rem 0.8rem; border-radius: 6px; transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { background: rgba(37, 99, 235, 0.08); color: var(--accent-blue); }
.nav-btn { background: var(--accent-blue); color: #fff !important; }

/* Mobile Menu Toggle Logic */
.menu-toggle-checkbox { display: none; }
.menu-toggle-label {
  display: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  .menu-toggle-label { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
  }
  .menu-toggle-checkbox:checked ~ .nav-links { display: flex; }
  .nav-links a { width: 100%; padding: 0.75rem 1rem; }
  .nav-btn { margin: 0.5rem 0 0 0; text-align: center; }
}

/* Grid Layout */
main {
  padding: var(--spacing-section) 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.bento-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 768px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bento-grid { grid-template-columns: repeat(3, 1fr); } .card-large { grid-column: span 2; } }

/* Cards */
.card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-margin-top: 140px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); }
.card h2 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.neon-cyan { border-top: 4px solid var(--accent-blue); }
.neon-purple { border-top: 4px solid var(--accent-indigo); }
.neon-green { border-top: 4px solid var(--accent-green); }
.neon-orange { border-top: 4px solid var(--accent-amber); }
.neon-teal { border-top: 4px solid var(--accent-teal); }
.neon-red { border-top: 4px solid var(--accent-red); }

/* Details & Interactive Tags */
.tech-details summary { cursor: pointer; font-weight: 600; font-size: 0.85rem; padding: 0.5rem; background: var(--bg-dark); border-radius: 6px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 0 0 0; list-style: none; margin: 0; }
.tag-list li { display: inline-block; }

.tag-btn {
  background: var(--bg-dark);
  color: var(--accent-blue);
  border: 1px solid transparent;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.tag-btn:hover, .tag-btn:focus {
  background: var(--accent-blue);
  color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Terminal UI Module */
.terminal-card { background: var(--term-bg); color: #fff; border: 1px solid #334155; }
.terminal-card h2 { color: #fff; }
.terminal-header { font-family: monospace; font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px solid #334155; padding-bottom: 0.5rem; }
.terminal-body { background: transparent; border: none; height: 250px; font-family: monospace; }
.chat-system { background: transparent; color: var(--accent-green); border: none; padding-left: 0; font-size: 0.9rem; }
.chat-user { background: #334155; color: #fff; font-size: 0.9rem; }
.terminal-input { background: transparent; border-top: 1px solid #334155; display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0 0 0; }
.prompt-symbol { color: var(--accent-green); font-weight: bold; }
.terminal-input input { background: transparent; border: none; color: #fff; flex: 1; outline: none; font-family: monospace; font-size: 0.9rem; }

/* Blog Links */
.blog-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.blog-list a { color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.blog-list a:hover { color: var(--accent-blue); }
.empty-state { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

/* Forms & Reddit Stream */
.reddit-form { display: flex; flex-direction: column; gap: 0.75rem; }
.reddit-input, .reddit-textarea { 
  background: var(--bg-dark); 
  border: 1px solid var(--border-color); 
  padding: 0.75rem; 
  border-radius: 6px; 
  font-family: inherit; 
  transition: all 0.2s ease;
}
.reddit-input:focus, .reddit-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

.form-actions { display: flex; justify-content: flex-end; }
.submit-btn { 
  background: var(--text-main); 
  color: #fff; 
  border: none; 
  padding: 0.6rem 1.2rem; 
  border-radius: 6px; 
  cursor: pointer; 
  font-weight: 600;
  transition: all 0.2s ease;
}
.submit-btn:hover { background: var(--accent-blue); transform: translateY(-1px); }
.submit-btn:active { transform: translateY(0); }

.reddit-stream { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.reddit-comment { padding: 1rem; border-left: 3px solid var(--border-color); background: var(--bg-dark); border-radius: 0 8px 8px 0; }
.comment-header { font-size: 0.8rem; margin-bottom: 0.25rem; }
.comment-author { font-weight: 700; }
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }


/* --- Shared Layout Classes (Reader & Forms) --- */
.reader-view {
  max-width: 800px;
  margin: 2rem auto 4rem auto;
  padding: 0 1.5rem;
}

.reader-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.reader-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0.5rem 0 0 0;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
  font-size: 0.95rem;
}

.back-link:hover {
  color: var(--accent-blue);
}

/* --- Form specific layout --- */
.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-row > input {
  flex: 1;
  min-width: 150px;
}

.form-row > select {
  flex: 1;
  cursor: pointer;
  min-width: 180px;
}

/* --- Comment Stream specifics --- */
.reddit-stream {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.comment-category {
  color: var(--accent-blue);
  font-size: 0.8rem;
  margin-left: 5px;
}

.reddit-stream .empty-state {
  text-align: center;
  padding: 2rem 0;
  margin: 0;
}

/* --- Upgraded Layout & Form Classes --- */
.reader-view { max-width: 800px; margin: 2rem auto 4rem auto; padding: 0 1.5rem; }
.reader-header { margin-bottom: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1.5rem; }
.reader-header h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0.5rem 0 0 0; line-height: 1.2; letter-spacing: -0.02em; }
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.back-link:hover { color: var(--accent-blue); }
.form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.form-row > input { flex: 1; min-width: 150px; }
.form-row > select { flex: 1; cursor: pointer; min-width: 180px; }
.comment-category { color: var(--accent-blue); font-size: 0.8rem; margin-left: 5px; }

/* --- Dynamic Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
  }
  
  .card, .prose { 
    box-shadow: 0 4px 20px rgba(0,0,0,0.3); 
    border-top: none; 
  }
  
  .site-header {
    background: rgba(15, 23, 42, 0.85);
  }
  
  /* Glowing borders instead of flat lines */
  .neon-cyan { box-shadow: 0 -2px 15px -5px var(--accent-blue), 0 4px 6px -1px rgba(0,0,0,0.2); }
  .neon-purple { box-shadow: 0 -2px 15px -5px var(--accent-indigo), 0 4px 6px -1px rgba(0,0,0,0.2); }
  .neon-green { box-shadow: 0 -2px 15px -5px var(--accent-green), 0 4px 6px -1px rgba(0,0,0,0.2); }
  .neon-orange { box-shadow: 0 -2px 15px -5px var(--accent-amber), 0 4px 6px -1px rgba(0,0,0,0.2); }
  .neon-teal { box-shadow: 0 -2px 15px -5px var(--accent-teal), 0 4px 6px -1px rgba(0,0,0,0.2); }
  .neon-red { box-shadow: 0 -2px 15px -5px var(--accent-red), 0 4px 6px -1px rgba(0,0,0,0.2); }
  
  .reddit-input, .reddit-textarea { background: #0f172a; color: #f8fafc; }
  .reddit-input:focus, .reddit-textarea:focus { background: #1e293b; }
}

/* --- Mobiele Optimalisaties voor Stamkroeg --- */
@media (max-width: 768px) {
    /* Zorg dat de bento-grid kaarten netjes onder elkaar komen te staan */
    .grid-container, .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Voorkom horizontale scroll op kleine schermen */
    body {
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    /* Zorg dat de header en navigatie niet buiten het scherm vallen */
    header {
        width: 100%;
        padding: 0.5rem 1rem;
        box-sizing: border-box;
    }

    /* Maak invoervelden en knoppen vriendelijk voor vingers op mobiel */
    input, textarea, button {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px; /* Voorkomt automatisch inzoomen op iOS */
    }
}
