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

:root {
  --ink: #f0efec;
  --ink-muted: #888;
  --ink-faint: #555;
  --paper: #0a0a0a;
  --paper-tint: #111;
  --paper-warm: #141414;
  --border: #222;
  --border-strong: #333;
  --accent: #e05240;
  --accent-soft: #1a0f0e;
  --tag-bg: #1a1a1a;
  --tag-color: #aaa;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --max-w: 760px;
  --nav-h: 64px;
}

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

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

/* ── GRAIN OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  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)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

/* ── NAV ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.logo-dot { color: var(--accent); }

.nav-links { display: flex; gap: 2rem; }

.nav-link {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active { color: var(--ink); }

.nav-link.active {
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ── MAIN ── */
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  flex: 1;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ── HERO ── */
.hero {
  padding: 5.5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.5rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 3rem;
  right: -2rem;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(192,57,43,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5.5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.hero-title em {
  font-style: italic;
  color: var(--ink-muted);
}

.hero-sub {
  font-size: 1rem;
  color: var(--ink-muted);
  font-weight: 300;
  max-width: 380px;
  line-height: 1.6;
}

/* ── POSTS ── */
.posts-section { margin-bottom: 5rem; }

.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: grid;
  grid-template-rows: auto auto auto auto;
  transition: background 0.2s;
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.25s ease;
}

.post-card:hover::before { transform: scaleY(1); }

.post-card:hover .post-title {
  color: var(--ink);
}

.post-card:hover .post-read {
  color: var(--accent);
}

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

.post-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--tag-bg);
  color: var(--tag-color);
  padding: 3px 9px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-date {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-weight: 300;
  font-family: var(--font-mono);
}

.post-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  color: var(--ink);
  transition: color 0.15s;
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 0.9rem;
  max-width: 580px;
  font-weight: 300;
}

.post-read {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

/* ── ABOUT ── */
.about-section { padding: 5rem 0; }

.about-content { max-width: 560px; }

.about-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  background: var(--paper-warm);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 2rem;
}

.about-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.about-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  line-height: 1.15;
}

.about-title em {
  font-style: italic;
  color: var(--ink-muted);
}

.about-body {
  margin-bottom: 3rem;
}

.about-body p {
  font-size: 1rem;
  color: var(--ink-muted);
  font-weight: 300;
  margin-bottom: 1.1rem;
  line-height: 1.75;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--ink);
  background: var(--tag-bg);
  padding: 1px 6px;
  border-radius: 3px;
}

.about-links {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.about-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  padding: 12px 20px;
  border-right: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.02em;
  flex: 1;
  justify-content: center;
  min-width: 120px;
}

.about-link:last-child { border-right: none; }

.about-link:hover {
  background: var(--ink);
  color: var(--paper);
}

.about-link svg { flex-shrink: 0; opacity: 0.7; }

/* ── ARTICLE ── */
.article { padding: 3rem 0 5rem; }

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 1rem;
}

.article-lead {
  font-size: 1.1rem;
  color: var(--ink-muted);
  font-weight: 300;
  line-height: 1.6;
  max-width: 540px;
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.article-body p {
  margin-bottom: 1.25rem;
  font-weight: 300;
  color: #c0bfbc;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--tag-bg);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink);
}

.article-body pre {
  background: #0f0f0f;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: #d4d4d4;
  font-size: 0.85rem;
  line-height: 1.7;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover { color: var(--ink); }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.hero, .about-section { animation: fadeUp 0.6s ease both; }

.post-card {
  animation: fadeUp 0.5s ease both;
}
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.10s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.20s; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .hero { padding: 3.5rem 0 2.5rem; }
  .hero-title { font-size: 2.2rem; }
  .about-links { flex-direction: column; }
  .about-link { border-right: none; border-bottom: 1px solid var(--border); }
  .about-link:last-child { border-bottom: none; }
  .post-card::before { display: none; }
  .nav { padding: 0 1.25rem; }
  .main { padding: 0 1.25rem; }
}
