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

:root {
  --bg: #f5f0e8;
  --ink: #1a1612;
  --muted: #7a6f62;
  --accent: #c0392b;
  --line: #d9d0c0;
  --max: 680px;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  line-height: 1.75;
  min-height: 100vh;
}

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

/* ── Header ── */
header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 2rem 2.5rem;
  border-bottom: 1px solid var(--line);
  animation: fadeDown .6s ease both;
}

.site-name {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.site-name span { color: var(--accent); }

nav {
  margin-top: .6rem;
  display: flex;
  gap: 1.8rem;
}

nav a {
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  font-weight: 300;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

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

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

/* ── Post list ── */
.post-list { list-style: none; }

.post-item {
  padding: 2.8rem 0;
  border-bottom: 1px solid var(--line);
  animation: fadeUp .5s ease both;
}

.post-item:nth-child(1) { animation-delay: .1s; }
.post-item:nth-child(2) { animation-delay: .2s; }
.post-item:nth-child(3) { animation-delay: .3s; }
.post-item:nth-child(4) { animation-delay: .4s; }

.post-meta {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  font-weight: 300;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: .7rem;
}

.post-title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s ease;
}

.post-title a:hover { background-size: 100% 1px; }

.post-excerpt {
  color: var(--muted);
  font-size: .95rem;
  max-width: 52ch;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1.2rem;
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: gap .2s;
}

.read-more:hover { gap: .8rem; }
.read-more::after { content: '→'; }

/* ── Single post ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin: 2.5rem 0 2rem;
  transition: color .2s, gap .2s;
}

.back-link::before { content: '←'; }
.back-link:hover { color: var(--accent); gap: .7rem; }

.post-full-title {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  animation: fadeDown .6s ease both;
}

.post-full-meta {
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  animation: fadeDown .6s .1s ease both;
}

.post-body {
  max-width: 62ch;
  animation: fadeUp .6s .15s ease both;
}

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

.post-body h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.5rem 0 .8rem;
}

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

.post-body pre {
  background: #ede8df;
  border-left: 2px solid var(--accent);
  padding: 1.2rem 1.5rem;
  margin: 1.8rem 0;
  overflow-x: auto;
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  line-height: 1.7;
  color: #3a2e26;
}

.post-body code {
  font-family: 'DM Mono', monospace;
  font-size: .85em;
}

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

.post-body a:hover { border-bottom-color: var(--accent); }

/* ── Footer ── */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer span {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

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

/* ── Tag pill ── */
.tag {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line);
  padding: .15rem .55rem;
  border-radius: 2px;
  margin-right: .5rem;
}

/* ── About / Archive pages ── */
.page-title {
  font-size: 2rem;
  font-weight: 600;
  margin: 2.5rem 0 .6rem;
  animation: fadeDown .6s ease both;
}

.page-body {
  max-width: 62ch;
  animation: fadeUp .5s .1s ease both;
}

.page-body p { margin-bottom: 1.4rem; color: var(--muted); }

.archive-year {
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.5rem 0 1rem;
}

.archive-list { list-style: none; }

.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  gap: 1rem;
  animation: fadeUp .4s ease both;
}

.archive-list li:nth-child(1) { animation-delay: .05s; }
.archive-list li:nth-child(2) { animation-delay: .1s; }
.archive-list li:nth-child(3) { animation-delay: .15s; }
.archive-list li:nth-child(4) { animation-delay: .2s; }

.archive-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  transition: color .2s;
}

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

.archive-date {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Animations ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
