
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@300;400;500&display=swap');

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

:root {
  --bg: #0f1117;
  --surface: #171b26;
  --surface2: #1f2535;
  --border: #2a3148;
  --amber: #f5a623;
  --amber-dim: #c8881c;
  --teal: #4ecdc4;
  --text: #d4dae8;
  --text-dim: #7a869a;
  --text-bright: #eef1f7;
  --mono: 'IBM Plex Mono', monospace;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── HEADER ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,17,23,0.92);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-title span { color: var(--text-dim); font-weight: 400; }
.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
  color: var(--text-dim); text-decoration: none;
  font-size: 0.85rem; font-weight: 400; letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a.active { color: var(--amber); }

/* ── HERO / INDEX ── */
.page-hero {
  padding: 5rem 2rem 3rem;
  max-width: 1100px; margin: 0 auto;
}
.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.page-hero p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 520px;
}
.hero-accent {
  display: inline-block;
  width: 40px; height: 3px;
  background: var(--amber);
  margin-bottom: 1.5rem;
}

/* ── FILTERS ── */
.filter-bar {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem 2.5rem;
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.filter-label {
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.1em; margin-right: 0.5rem;
}
.filter-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); padding: 0.35rem 0.9rem;
  border-radius: 2px; cursor: pointer; font-family: var(--sans);
  font-size: 0.8rem; transition: all 0.15s; white-space: nowrap;
}
.filter-btn:hover { border-color: var(--amber); color: var(--amber); }
.filter-btn.active { background: var(--amber); border-color: var(--amber); color: #0f1117; font-weight: 500; }

/* ── POST GRID ── */
.posts-grid {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5px;
  background: var(--border);
  border: 1px solid var(--border);
}
.post-card {
  background: var(--surface);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: background 0.15s;
  position: relative;
}
.post-card:hover { background: var(--surface2); }
.post-card:hover .card-title { color: var(--amber); }
.card-meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim);
  letter-spacing: 0.04em;
}
.card-cat {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 0.2rem 0.5rem; border-radius: 2px;
  color: var(--teal); font-size: 0.65rem;
}
.card-title {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 700;
  color: var(--text-bright); line-height: 1.3;
  transition: color 0.15s;
}
.card-excerpt {
  font-size: 0.88rem; color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-arrow {
  margin-top: auto;
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim);
  display: flex; align-items: center; gap: 0.4rem;
}
.card-arrow::after { content: '→'; transition: transform 0.15s; }
.post-card:hover .card-arrow::after { transform: translateX(4px); }

/* ── SINGLE POST ── */
.post-layout {
  max-width: 780px; margin: 0 auto;
  padding: 4rem 2rem 6rem;
}
.post-header { margin-bottom: 3rem; }
.post-breadcrumb {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-dim); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.post-breadcrumb a { color: var(--amber); text-decoration: none; }
.post-breadcrumb a:hover { text-decoration: underline; }
.post-cats {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.post-cat-badge {
  background: transparent; border: 1px solid var(--teal);
  color: var(--teal); padding: 0.25rem 0.65rem;
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 2px;
}
.post-title {
  font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; color: var(--text-bright); line-height: 1.2;
  margin-bottom: 1rem;
}
.post-date {
  font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim);
}
.post-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── POST CONTENT ── */
.post-content { font-size: 1.02rem; line-height: 1.8; }
.post-content p { margin-bottom: 1.4em; }
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  font-family: var(--serif); color: var(--text-bright);
  margin: 2em 0 0.75em; line-height: 1.25;
}
.post-content h2 { font-size: 1.7rem; }
.post-content h3 { font-size: 1.3rem; }
.post-content a { color: var(--amber); text-decoration: none; }
.post-content a:hover { text-decoration: underline; }
.post-content ul, .post-content ol {
  margin: 0 0 1.4em 1.5rem; padding: 0;
}
.post-content li { margin-bottom: 0.4em; }
.post-content blockquote {
  border-left: 3px solid var(--amber);
  padding: 0.5em 0 0.5em 1.25em;
  margin: 1.5em 0; color: var(--text-dim);
  font-style: italic;
}
.post-content code {
  background: var(--surface2); color: var(--teal);
  font-family: var(--mono); font-size: 0.88em;
  padding: 0.15em 0.4em; border-radius: 3px;
}
.post-content pre {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 1.25rem; border-radius: 4px; overflow-x: auto;
  margin: 1.5em 0;
}
.post-content pre code {
  background: none; padding: 0; border-radius: 0; font-size: 0.85em;
}
.post-content img {
  max-width: 100%; height: auto; border-radius: 3px;
  border: 1px solid var(--border); margin: 1em 0;
  display: block;
}
.post-content figure { margin: 1.5em 0; }
.post-content figcaption {
  font-size: 0.82rem; color: var(--text-dim);
  font-style: italic; margin-top: 0.5em; text-align: center;
}
.post-content table {
  width: 100%; border-collapse: collapse; margin: 1.5em 0;
  font-size: 0.9rem;
}
.post-content th {
  background: var(--surface2); color: var(--amber);
  font-family: var(--mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.6rem 0.9rem; border: 1px solid var(--border);
  text-align: left;
}
.post-content td {
  padding: 0.6rem 0.9rem; border: 1px solid var(--border);
}
.post-content tr:nth-child(even) td { background: var(--surface2); }

/* ── POST NAV ── */
.post-nav {
  margin-top: 4rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.post-nav-link {
  background: var(--surface); border: 1px solid var(--border);
  padding: 1.25rem; text-decoration: none; color: inherit;
  transition: border-color 0.15s;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.post-nav-link:hover { border-color: var(--amber); }
.post-nav-link.next { text-align: right; }
.nav-dir {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em;
}
.nav-title {
  font-family: var(--serif); font-size: 1rem;
  color: var(--text-bright); line-height: 1.3;
}

/* ── STATIC PAGES ── */
.page-layout {
  max-width: 780px; margin: 0 auto;
  padding: 4rem 2rem 6rem;
}
.page-title {
  font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; color: var(--text-bright); margin-bottom: 2rem;
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim);
}
.site-footer a { color: var(--amber); text-decoration: none; }

/* ── EMPTY STATE ── */
.no-posts {
  max-width: 1100px; margin: 0 auto;
  padding: 4rem 2rem; text-align: center;
  color: var(--text-dim); font-family: var(--mono);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 0.75rem; }
  .site-nav { gap: 1rem; }
}
