:root {
  --bg: #F6F5F2;
  --bg-elevated: #EDECEA;
  --bg-code: #E6E5E2;
  --text: #1a1a1a;
  --text-muted: #4A4B48;
  --text-dim: #74766F;
  --accent: #7A5A0B;
  --accent-dim: rgba(122, 90, 11, 0.1);
  --serif: 'Playfair Display', Georgia, serif;
  --body-serif: 'DM Sans', -apple-system, sans-serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --content-width: 700px;
  --gutter: 1.5rem;
}

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

html { font-size: 18px; -webkit-font-smoothing: antialiased; }

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

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* Header */
header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4rem var(--gutter) 3rem;
  border-bottom: 1px solid rgba(122, 90, 11, 0.15);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.glass {
  font-size: 2.2rem;
  filter: grayscale(0.2) brightness(1.0);
  flex-shrink: 0;
}

.site-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.site-tagline {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.35rem;
}

/* Nav */
nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  gap: 2rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
nav a:hover { color: var(--accent); }

/* Main content */
main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) 6rem;
}

/* Post index (homepage) */
.post-list { list-style: none; }

.post-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: border-color 0.3s;
}
.post-item:hover { border-bottom-color: rgba(122, 90, 11, 0.25); }

.post-date {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.post-title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 0.3rem;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.post-title a:hover { color: var(--accent); }

.post-tags {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.post-excerpt {
  font-family: var(--body-serif);
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

/* Single post page */
.post-header {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.post-header .post-date { margin-bottom: 0.75rem; }

.post-header h1 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.015em;
}

/* Article body */
article h2 {
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 2.8rem 0 1rem;
}

article h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

article p {
  margin-bottom: 1.4rem;
  font-size: 1.05rem;
}

article a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 90, 11, 0.35);
  transition: border-color 0.2s;
}
article a:hover { border-bottom-color: var(--accent); }

article blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05rem;
  border-radius: 0 4px 4px 0;
}

article pre {
  background: var(--bg-code);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 5px;
  padding: 1.25rem 1.5rem;
  margin: 1.8rem 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-muted);
}

article code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

article pre code {
  background: none;
  padding: 0;
  color: inherit;
}

article img {
  max-width: 100%;
  border-radius: 4px;
  margin: 2rem 0;
}

article ul, article ol {
  padding-left: 1.4rem;
  margin-bottom: 1.4rem;
}

article li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

/* Divider */
hr {
  border: none;
  height: 1px;
  background: rgba(122, 90, 11, 0.12);
  margin: 3rem 0;
}

/* Footer */
footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) 4rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}
footer a:hover { color: var(--accent); }
