/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f0f0f;
  --bg-card:     #161616;
  --bg-hover:    #1c1c1c;
  --border:      #2a2a2a;
  --text:        #e8e6e1;
  --text-muted:  #7a7874;
  --text-faint:  #3d3d3d;
  --accent:      #c9a96e;
  --accent-dim:  #8a6e3e;
  --code-bg:     #1a1a1a;
  --tag-bg:      #1e1e1e;
  --tag-text:    #9a9590;
  --font-serif:  'DM Serif Display', Georgia, serif;
  --font-sans:   'DM Sans', system-ui, sans-serif;
  --font-mono:   'DM Mono', 'Courier New', monospace;
  --max-width:   740px;
  --radius:      4px;
}

html { font-size: 17px; }

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

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

main.container {
  flex: 1;
  padding-top: 4rem;
  padding-bottom: 5rem;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  background: rgba(15,15,15,0.92);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.site-title:hover { color: var(--accent); }

.site-header nav { display: flex; gap: 1.8rem; }
.site-header nav a {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-header nav a:hover { color: var(--text); }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.hero-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.9rem;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
  font-weight: 400;
  font-style: italic;
}
.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  font-weight: 300;
}

/* ─── Post List ─────────────────────────────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 0; }

.post-card {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.post-card:first-child { padding-top: 0; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.post-meta time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.tag {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2em 0.55em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-weight: 500;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.55rem;
}
.post-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.post-card-title a:hover { color: var(--accent); }

.post-card-summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.65;
}

.read-more {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.read-more:hover { color: var(--accent); }

/* ─── Full Post ─────────────────────────────────────────────────────────────── */
.post-header { margin-bottom: 2.5rem; }

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0.6rem 0 0.8rem;
}

.post-summary {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.post-divider {
  height: 1px;
  background: var(--border);
  margin-top: 1.5rem;
}

/* ─── Post Body ─────────────────────────────────────────────────────────────── */
.post-body {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #d4d1cb;
}

.post-body h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text);
  margin: 2.5rem 0 0.8rem;
  letter-spacing: -0.01em;
}
.post-body h3 {
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 2rem 0 0.6rem;
}

.post-body p { margin-bottom: 1.4rem; }

.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.2s, color 0.2s;
}
.post-body a:hover {
  color: var(--text);
  border-color: var(--text);
}

.post-body blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.8rem 0;
  padding: 0.5rem 0 0.5rem 1.4rem;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.post-body ul, .post-body ol {
  margin: 0.5rem 0 1.4rem 1.4rem;
}
.post-body li { margin-bottom: 0.35rem; }

.post-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  color: #b8c4d0;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.post-body pre code {
  background: none;
  padding: 0;
  border: none;
  color: #c0ccd8;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.post-body th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--accent-dim);
}
.post-body td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.post-footer a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
}
.post-footer a:hover { color: var(--accent); }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}
.site-footer .container {
  display: flex;
  justify-content: center;
}
.site-footer span {
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  main.container { padding-top: 2.5rem; }
  .hero { padding: 2rem 0 2rem; }
  .post-body pre { padding: 0.9rem 1rem; font-size: 0.8rem; }
}

/* ─── Images ────────────────────────────────────────────────────────────────── */
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

/* Image with caption — use figure/figcaption in markdown */
.post-body figure {
  margin: 2.5rem 0;
  text-align: center;
}
.post-body figure img {
  margin: 0 auto 0.75rem;
}
.post-body figcaption {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Side-by-side image grid */
.post-body .image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}
.post-body .image-grid img {
  margin: 0;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

@media (max-width: 600px) {
  .post-body .image-grid { grid-template-columns: 1fr; }
  .post-body .image-grid img { height: auto; }
}
