:root {
  --bg: #fcfcfc;
  --ink: #18181b;
  --muted: #71717a;
  --rule: #e4e4e7;
  --hover: #000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 14vh 24px 12vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- homepage ---------- */

h1 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 0.25rem;
}

.tagline {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.about {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 4rem;
}

section {
  margin-bottom: 3rem;
}

section h2 {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

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

.links-list li {
  border-bottom: 1px solid var(--rule);
}

.links-list li:first-child {
  border-top: 1px solid var(--rule);
}

.links-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  transition: color 120ms ease, padding-left 200ms ease;
}

.links-list a:hover {
  color: var(--hover);
  padding-left: 0.25rem;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-feature-settings: "tnum";
}

.links-list a:hover .meta { color: var(--muted); }

.arrow {
  color: var(--muted);
  transition: transform 200ms ease;
  display: inline-block;
}

.links-list a:hover .arrow {
  transform: translateX(3px);
  color: var(--ink);
}

.building-note {
  color: var(--muted);
  line-height: 1.6;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* ---------- post page ---------- */

.back-link {
  margin-bottom: 5rem;
}

.back-link a {
  color: var(--muted);
  font-size: 0.875rem;
  transition: color 120ms ease;
}

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

article {
  margin-bottom: 4rem;
}

.post-meta {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 2rem;
}

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

.post-body h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 0.85rem;
  letter-spacing: -0.005em;
}

.post-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
}

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

.post-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--rule);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.post-body pre {
  background: var(--rule);
  padding: 1rem 1.25rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

.post-body pre code {
  background: transparent;
  padding: 0;
  font-size: 0.85em;
}

.post-body ul, .post-body ol {
  margin: 0 0 1.25rem 1.25rem;
  padding: 0;
}

.post-body ul li, .post-body ol li {
  border: none;
  padding: 0.15rem 0;
  display: list-item;
  margin-left: 0.25rem;
}

.post-body ul li { list-style: disc; }
.post-body ol li { list-style: decimal; }

.post-body img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 3px;
}

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

.post-body a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 120ms ease;
}

.post-body a:hover {
  text-decoration-color: var(--ink);
}

/* ---------- responsive + dark ---------- */

@media (max-width: 480px) {
  main { padding: 10vh 20px 10vh; }
  section { margin-bottom: 2.5rem; }
  .back-link { margin-bottom: 3.5rem; }
  .post-title { font-size: 1.55rem; margin-bottom: 2.5rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --ink: #ededee;
    --muted: #8a8a93;
    --rule: #26262a;
    --hover: #fff;
  }
}
