@font-face {
  font-family: 'JetBrainsMono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap; /* verhindert unsichtbaren Text beim Laden */
}

@font-face {
  font-family: 'SourceSerif4';
  src: url('/fonts/SourceSerif4-VariableFont_opsz,wght.ttf') format('truetype');
  font-display: swap; /* verhindert unsichtbaren Text beim Laden */
}

:root {
  --bg: #f8f7f4;
  --fg: #1a1a18;
  --muted: #121111;
  --accent: #2a5cff;
  --border: #e0dfd9;
  --code-bg: #eeecea;
  --max-w: 860px;
  --font-body: 'SourceSerif4', Georgia, serif;
  --font-mono: 'JetBrainsMono', 'Courier New', monospace;
  --font-size-medium: 1rem;
  --font-line-height-medium: 1.75;
}

[data-theme="dark"] {
  --bg: #0f0f0e;
  --fg: #e8e6e0;
  --muted: #b0b0b0;
  --accent: #5b7fff;
  --border: #2a2a28;
  --code-bg: #1c1c1a;
}

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

html {
    font-size: var(--font-size-medium);
    -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: var(--font-line-height-medium);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  word-wrap: break-word;
}

/* ── Layout ─────────────────────────────── */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

main {
    flex: 1;
    padding: 4rem 0 6rem;
}

/* ── Header ─────────────────────────────── */
.site-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-mono);
  font-size: var(--font-size-medium);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--fg);
}

.site-title::before {
    content: './';
    color: var(--accent);
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

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

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  padding: 0.2em 0.5em;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}

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

.theme-toggle-icon::before { content: '◑'; }
[data-theme="dark"] .theme-toggle-icon::before { content: '◐'; }

/* ── Footer ─────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.site-footer .site-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ── Post List ──────────────────────────── */
.post-list { list-style: none; margin-top: 3rem; }

.post-list-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.post-list-item:first-child { padding-top: 0; }

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15em 0.5em;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: border-color 0.15s, color 0.15s;
}

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

.post-list-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.post-list-title a {
  text-decoration: none;
  color: var(--fg);
  transition: color 0.15s;
}

.post-list-title a:hover { color: var(--accent); }

.post-summary {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  font-style: italic;
  font-weight: 300;
}

/* ── Single Post ────────────────────────── */
.post-header { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }

.post-header .post-meta { margin-bottom: 1rem; }

.post-title {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

/* ── Article Content ────────────────────── */
.post-content { line-height: 1.8; }

.post-content h2, .post-content h3, .post-content h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.75rem;
  line-height: 1.25;
}

.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.2rem; }

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

.post-content a { color: var(--accent); text-underline-offset: 3px; }
.post-content a:hover { opacity: 0.75; }

.post-content ul, .post-content ol {
  margin: 0 0 1.5rem 1.5rem;
}

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

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: var(--muted);
  font-style: italic;
}

.post-content blockquote p { margin-bottom: 0; }

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: #c0392b;
}

.post-content pre {
  background: #1e1e1e;
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  color: #d4d4d4;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}

.post-content img {
  max-width: 100%;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.post-figure {
  margin: 2rem 0;
  text-align: center;
}

.post-figure figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-style: italic;
}

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

/* ── Inline source refs [N] ─────────────── */
.source-ref {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  vertical-align: super;
  line-height: 0;
}

.source-ref:hover { text-decoration: underline; }

/* ── Sources section ────────────────────── */
.post-sources {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-sources h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.post-sources ol {
  padding-left: 1.5em;
  margin: 0;
  color: var(--muted);
}

.post-sources li {
  margin-bottom: 0.1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.post-sources a {
  color: var(--accent);
  text-underline-offset: 3px;
  word-break: break-word;
}

.post-sources a:hover { opacity: 0.75; }

.sources-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Reading Progress ───────────────────── */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Page Intro ─────────────────────────── */
.page-intro {
  padding: 3rem 0 0;
}

.page-intro h1 {
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ── Pagination ─────────────────────────── */
.pagination {
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.03em;
}

.pagination a:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .post-title { font-size: 1.75rem; }
  .site-header { padding: 1.5rem 0; }
}
