@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Mono:wght@400;500&family=Inter:wght@400;500&display=swap');

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

:root {
  --ink: #1a1a1a;
  --muted: #666;
  --accent: #c84b2f;
  --border: #e0e0e0;
  --bg: #fafafa;
  --max-w: 680px;
}

html {
  font-size: 18px;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

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

/* ---- Layout ---- */

header {
  padding: 2rem 2rem 0;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.site-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

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

main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 4rem 2rem;
}

footer {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

footer a {
  color: var(--muted);
}

/* ---- Hero ---- */

.hero {
  margin-bottom: 5rem;
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  font-weight: 400;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.hero .subhead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 540px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.cta {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--ink);
  padding: 0.65rem 1.25rem;
  border-radius: 2px;
  transition: background 0.15s;
}

.cta:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---- Problem ---- */

.problem {
  margin-bottom: 5rem;
}

.problem p {
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.problem p:last-child {
  margin-bottom: 0;
}

/* ---- How It Works ---- */

.how-it-works {
  margin-bottom: 5rem;
}

.how-it-works h2 {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.how-it-works ol {
  list-style: none;
  counter-reset: steps;
}

.how-it-works ol li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0 1rem;
  margin-bottom: 1.25rem;
  align-items: baseline;
}

.how-it-works ol li::before {
  content: counter(steps);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  padding-top: 0.2rem;
}

.step-label {
  font-weight: 500;
}

/* ---- Posts section (homepage) ---- */

.posts h2 {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.posts ul {
  list-style: none;
}

.posts ul li {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.posts ul li:last-child {
  border-bottom: 1px solid var(--border);
}

.posts ul li a {
  font-weight: 500;
  text-decoration: none;
}

.posts ul li a:hover {
  color: var(--accent);
}

.posts .post-desc {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- Post list page ---- */

.post-list h1 {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.post-list ul {
  list-style: none;
}

.post-list ul li {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-list ul li:last-child {
  border-bottom: 1px solid var(--border);
}

.post-list ul li a {
  font-weight: 500;
  text-decoration: none;
}

.post-list ul li a:hover {
  color: var(--accent);
}

.post-list .post-desc {
  font-size: 0.9rem;
  color: var(--muted);
}

.post-list .post-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---- Single post ---- */

.post-header {
  margin-bottom: 3rem;
}

.post-header .post-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.post-header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.post-header .post-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}

.post-body {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
}

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

.post-body h2 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-weight: 600;
  font-size: 1rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.01em;
}

.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}

.post-body li {
  margin-bottom: 0.4rem;
}

.post-body code {
  font-family: 'DM Mono', monospace;
  font-size: 0.85em;
  background: #efefef;
  padding: 0.15em 0.4em;
  border-radius: 2px;
}

.post-body strong {
  font-weight: 600;
}

/* ---- Mobile ---- */

@media (max-width: 600px) {
  main {
    padding: 2.5rem 1.25rem;
  }

  header {
    padding: 1.5rem 1.25rem 0;
  }

  footer {
    padding: 1.5rem 1.25rem 2rem;
  }

  .hero {
    margin-bottom: 3.5rem;
  }

  .problem, .how-it-works {
    margin-bottom: 3.5rem;
  }
}
